QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#76282#5057. Prof. Pang's sequenceaouiAC ✓1113ms62204kbC++202.2kb2023-02-08 22:29:592023-02-08 22:30:03

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-02-08 22:30:03]
  • 评测
  • 测评结果:AC
  • 用时:1113ms
  • 内存:62204kb
  • [2023-02-08 22:29:59]
  • 提交

answer

#include<cstdio>
#include<algorithm>
using namespace std;
namespace IO{
	const int sz=1<<22;
	char a[sz+5],b[sz+5],*p1=a,*p2=a,*t=b,p[105];
	inline char gc(){
		return p1==p2?(p2=(p1=a)+fread(a,1,sz,stdin),p1==p2?EOF:*p1++):*p1++;
	}
	template<class T> void read(T& x){
		x=0; char c=gc();
		for(;c<'0'||c>'9';c=gc());
		for(;c>='0'&&c<='9';c=gc())
			x=x*10+(c-'0');
	}
	inline void flush(){fwrite(b,1,t-b,stdout),t=b; }
	inline void pc(char x){*t++=x; if(t-b==sz) flush(); }
	template<class T> void write(T x,char c='\n'){
		if(x<0) pc('-'), x=-x;
		if(x==0) pc('0'); int t=0;
		for(;x;x/=10) p[++t]=x%10+'0';
		for(;t;--t) pc(p[t]); pc(c);
	}
	struct F{~F(){flush();}}f;
}
using IO::read;
using IO::write;
const int N=5e5+5;
int n,m,a[N],b[N],nxt[N],ql[N],qr[N],q[N],t[N<<2][2],tag[N<<2],tb[N<<2][2];
long long ans[N],sum[N<<2];
bool cmp(int x,int y){return qr[x]<qr[y];}
void build(int v,int l,int r)
{
	t[v][0]=r-l+1;
	if(l==r)return;
	int mid=l+r>>1;
	build(v<<1,l,mid);
	build(v<<1|1,mid+1,r);
}
void pt(int v,int t0,int t1,int tt)
{
	sum[v]+=1ll*t[v][0]*t1+1ll*t[v][1]*t0;
	if(tt)swap(t[v][0],t[v][1]);
	tb[v][tag[v]]+=t0;
	tb[v][tag[v]^1]+=t1;
	tag[v]^=tt;
}
void push(int v)
{
	pt(v<<1,tb[v][0],tb[v][1],tag[v]);
	pt(v<<1|1,tb[v][0],tb[v][1],tag[v]);
	tag[v]=tb[v][0]=tb[v][1]=0;
}
void upt(int v,int l,int r,int x,int y,int z)
{
	if(l>=x&&r<=y)return pt(v,!z,z,z),void();
	push(v);
	int mid=l+r>>1;
	if(x<=mid)upt(v<<1,l,mid,x,y,z);
	if(mid<y)upt(v<<1|1,mid+1,r,x,y,z);
	sum[v]=sum[v<<1]+sum[v<<1|1];
	t[v][0]=t[v<<1][0]+t[v<<1|1][0];
	t[v][1]=t[v<<1][1]+t[v<<1|1][1];
}
long long que(int v,int l,int r,int x,int y)
{
	if(l>=x&&r<=y)return sum[v];
	push(v);
	int mid=l+r>>1;
	long long res=0;
	if(x<=mid)res+=que(v<<1,l,mid,x,y);
	if(mid<y)res+=que(v<<1|1,mid+1,r,x,y);
	return res;
}
int main()
{
	read(n);
	for(int i=1;i<=n;i++)read(a[i]),nxt[i]=b[a[i]],b[a[i]]=i;
	read(m);
	for(int i=1;i<=m;i++)read(ql[i]),read(qr[i]),q[i]=i;
	sort(q+1,q+1+m,cmp);
	build(1,1,n);
	for(int i=1,j=1;i<=n;i++)
	{
		upt(1,1,n,nxt[i]+1,i,1);
		if(nxt[i])upt(1,1,n,1,nxt[i],0);
		for(;j<=m&&qr[q[j]]==i;j++)ans[q[j]]=que(1,1,n,ql[q[j]],i);
	}
	for(int i=1;i<=m;i++)write(ans[i]);
	return 0;
}

详细

Test #1:

score: 100
Accepted
time: 3ms
memory: 21096kb

input:

5
1 2 3 2 1
5
1 5
2 4
1 3
2 5
4 4

output:

10
3
4
6
1

result:

ok 5 number(s): "10 3 4 6 1"

Test #2:

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

input:

5
2 3 5 1 5
5
2 3
1 1
1 3
2 5
2 4

output:

2
1
4
6
4

result:

ok 5 number(s): "2 1 4 6 4"

Test #3:

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

input:

10
2 8 5 1 10 5 9 9 3 5
10
6 8
1 2
3 5
5 7
1 7
3 9
4 9
1 4
3 7
2 5

output:

4
2
4
4
16
16
12
6
9
6

result:

ok 10 numbers

Test #4:

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

input:

100
2 8 5 1 10 5 9 9 3 5 6 6 2 8 2 2 6 3 8 7 2 5 3 4 3 3 2 7 9 6 8 7 2 9 10 3 8 10 6 5 4 2 3 4 4 5 2 2 4 9 8 5 3 8 8 10 4 2 10 9 7 6 1 3 9 7 1 3 5 9 7 6 1 10 1 1 7 2 4 9 10 4 5 5 7 1 7 7 2 9 5 10 7 4 8 9 9 3 10 2
100
16 34
40 59
5 31
7 78
74 87
22 46
25 73
30 71
74 78
13 98
87 91
37 62
56 68
56 75
3...

output:

88
112
186
1260
61
209
547
382
9
1453
9
186
48
117
123
1
104
317
1540
264
317
294
453
867
945
208
159
891
1701
21
872
63
334
683
768
659
703
1116
679
77
447
639
130
1619
415
868
334
63
22
2
21
81
754
474
1799
85
424
1626
37
644
856
40
718
558
80
90
30
829
607
669
363
391
394
1151
724
251
87
115
200
...

result:

ok 100 numbers

Test #5:

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

input:

100
42 68 35 1 70 25 79 59 63 65 6 46 82 28 62 92 96 43 28 37 92 5 3 54 93 83 22 17 19 96 48 27 72 39 70 13 68 100 36 95 4 12 23 34 74 65 42 12 54 69 48 45 63 58 38 60 24 42 30 79 17 36 91 43 89 7 41 43 65 49 47 6 91 30 71 51 7 2 94 49 30 24 85 55 57 41 67 77 32 9 45 40 27 24 38 39 19 83 30 42
100
1...

output:

102
110
196
1336
57
169
625
461
9
1878
9
184
48
110
132
1
90
362
1854
256
254
254
362
651
1189
169
169
815
2178
20
654
56
344
782
627
811
784
1481
703
81
600
574
121
2042
439
1117
344
64
20
2
20
80
647
381
2357
81
342
1990
36
673
1088
42
619
442
81
90
30
629
676
783
461
304
308
1400
553
290
90
100
1...

result:

ok 100 numbers

Test #6:

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

input:

100
2 2 1 1 2 1 1 1 1 1 2 2 2 2 2 2 2 1 2 1 2 1 1 2 1 1 2 1 1 2 2 1 2 1 2 1 2 2 2 1 2 2 1 2 2 1 2 2 2 1 2 1 1 2 2 2 2 2 2 1 1 2 1 1 1 1 1 1 1 1 1 2 1 2 1 1 1 2 2 1 2 2 1 1 1 1 1 1 2 1 1 2 1 2 2 1 1 1 2 2
100
16 34
40 59
5 31
7 78
74 87
22 46
25 73
30 71
74 78
13 98
87 91
37 62
56 68
56 75
32 53
51 5...

output:

24
41
62
167
29
34
113
104
8
186
7
51
35
63
31
1
25
72
195
60
89
89
67
99
153
33
56
112
211
15
99
18
95
134
93
138
120
164
131
28
114
125
28
207
83
149
95
39
29
3
29
25
95
57
217
40
66
205
16
129
149
32
94
69
36
38
15
93
115
134
104
93
92
160
80
69
61
25
76
105
77
38
38
41
170
61
5
140
23
155
84
206...

result:

ok 100 numbers

Test #7:

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

input:

100
2 4 3 1 2 1 3 3 3 1 2 2 2 4 2 4 4 3 4 1 4 1 3 2 1 3 2 1 3 4 4 3 4 3 2 1 4 4 4 3 4 4 3 2 2 1 2 4 2 1 4 1 3 2 2 4 4 2 2 3 1 4 3 3 1 3 1 3 1 1 3 2 3 2 3 3 3 2 2 1 2 4 1 3 1 1 3 1 4 1 1 4 3 4 2 3 3 3 2 2
100
16 34
40 59
5 31
7 78
74 87
22 46
25 73
30 71
74 78
13 98
87 91
37 62
56 68
56 75
32 53
51 5...

output:

62
64
106
304
38
83
178
143
8
406
9
87
37
86
76
1
46
123
389
107
173
174
128
176
313
78
94
197
429
17
177
35
190
290
196
280
216
369
277
65
244
261
63
407
138
324
190
49
17
2
16
63
193
130
459
56
126
410
37
277
293
46
187
137
78
86
32
173
189
282
206
195
199
335
161
136
68
52
137
180
97
97
86
106
38...

result:

ok 100 numbers

Test #8:

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

input:

10000
2 4 3 1 2 1 3 3 3 1 2 2 2 4 2 4 4 3 4 1 4 1 3 2 1 3 2 1 3 4 4 3 4 3 2 1 4 4 4 3 4 4 3 2 2 1 2 4 2 1 4 1 3 2 2 4 4 2 2 3 1 4 3 3 1 3 1 3 1 1 3 2 3 2 3 3 3 2 2 1 2 4 1 3 1 1 3 1 4 1 1 4 3 4 2 3 3 3 2 2 2 4 4 3 1 3 2 3 2 3 2 2 1 1 3 2 2 2 2 1 3 3 2 1 4 4 4 3 4 1 3 3 2 1 3 3 4 4 4 2 2 4 2 4 2 2 2 ...

output:

36321
35405
1209
25190
40287
17354
4347
12364
19345
22868
33513
19988
21050
22371
4155
16423
19777
13766
36851
10463
655
21282
27833
14587
2094
7224
26214
5101
19637
12315
36315
31986
29611
4264
34081
25650
10369
10690
42069
9478
18835
5647
3738
25622
26508
8411
5704
32775
19620
23373
27204
5543
102...

result:

ok 10000 numbers

Test #9:

score: 0
Accepted
time: 14ms
memory: 21672kb

input:

10000
2 8 5 1 10 5 9 9 3 5 6 6 2 8 2 2 6 3 8 7 2 5 3 4 3 3 2 7 9 6 8 7 2 9 10 3 8 10 6 5 4 2 3 4 4 5 2 2 4 9 8 5 3 8 8 10 4 2 10 9 7 6 1 3 9 7 1 3 5 9 7 6 1 10 1 1 7 2 4 9 10 4 5 5 7 1 7 7 2 9 5 10 7 4 8 9 9 3 10 2 4 6 10 9 5 1 8 7 4 7 2 6 5 3 1 10 8 4 8 3 7 1 2 7 6 8 6 5 2 3 1 1 2 5 7 1 8 2 8 8 8 8...

output:

121676
121523
3628
86267
138275
58850
13317
40670
63807
74277
107841
66609
70556
74015
14448
54400
68407
44066
124066
35926
2111
68998
91062
49395
6818
27160
89176
19812
64970
38456
121158
107877
101875
14130
117171
88392
35239
34015
144173
33217
65218
20707
11384
88427
90982
26416
18798
108907
6626...

result:

ok 10000 numbers

Test #10:

score: 0
Accepted
time: 22ms
memory: 21792kb

input:

10000
42 68 35 1 70 25 79 59 63 65 6 46 82 28 62 92 96 43 28 37 92 5 3 54 93 83 22 17 19 96 48 27 72 39 70 13 68 100 36 95 4 12 23 34 74 65 42 12 54 69 48 45 63 58 38 60 24 42 30 79 17 36 91 43 89 7 41 43 65 49 47 6 91 30 71 51 7 2 94 49 30 24 85 55 57 41 67 77 32 9 45 40 27 24 38 39 19 83 30 42 34 ...

output:

2086076
1741366
11967
1193241
2110395
789795
142677
548677
887034
1186670
1761104
916514
998932
1073026
130271
816651
950616
612723
1894013
431282
5293
1061786
1388067
814119
41390
318618
1577376
209314
937347
556324
1871841
1576377
1414009
140524
1697550
1236904
665387
460557
2366910
467173
896169
...

result:

ok 10000 numbers

Test #11:

score: 0
Accepted
time: 14ms
memory: 21808kb

input:

10000
42 468 335 501 170 725 479 359 963 465 706 146 282 828 962 492 996 943 828 437 392 605 903 154 293 383 422 717 719 896 448 727 772 539 870 913 668 300 36 895 704 812 323 334 674 665 142 712 254 869 548 645 663 758 38 860 724 742 530 779 317 36 191 843 289 107 41 943 265 649 447 806 891 730 371...

output:

11554412
10707633
12445
5347584
14025479
2523856
160056
1274581
3158550
4473303
9676996
3520204
3883961
4306275
150989
2484683
3332887
1577078
11744904
966279
5331
3847822
6752488
1931344
38391
464404
6205172
249674
3378305
1255895
11134967
8854999
7618079
159796
10022680
5591698
963405
933305
15535...

result:

ok 10000 numbers

Test #12:

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

input:

10000
42 8468 6335 6501 9170 5725 1479 9359 6963 4465 5706 8146 3282 6828 9962 492 2996 1943 4828 5437 2392 4605 3903 154 293 2383 7422 8717 9719 9896 5448 1727 4772 1539 1870 9913 5668 6300 7036 9895 8704 3812 1323 334 7674 4665 5142 7712 8254 6869 5548 7645 2663 2758 38 2860 8724 9742 7530 779 231...

output:

24129088
24514134
24523544
24335849
24124639
24583022
24598013
24434757
24326327
24816819
24168451
24429742
24543587
24558374
24602958
24489071
24474276
24647678
24424942
24221826
24697217
24727161
24607980
24811837
24105079
24469296
24801840
24951537
24617800
24508898
24811923
24816800
24390196
245...

result:

ok 10000 numbers

Test #13:

score: 0
Accepted
time: 807ms
memory: 59020kb

input:

500000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

26525608956
55068350646
78385231653
2553372991
3032374626
1161740503
86796900
5085512526
5041033845
34590154731
30748900078
12684183175
29646733753
18675003691
20214471915
6144138378
4122183801
70004400753
6603590503
4709108628
40623758280
7678269081
46503197965
4470371290
27990371503
30688173153
77...

result:

ok 500000 numbers

Test #14:

score: 0
Accepted
time: 809ms
memory: 61884kb

input:

500000
2 1 2 2 2 1 2 2 1 2 2 2 1 1 2 1 2 1 2 1 1 2 2 2 1 2 2 1 1 1 2 1 1 1 1 1 1 1 1 1 2 2 2 1 1 2 1 2 2 2 2 2 2 1 2 1 1 2 1 1 2 1 1 2 1 2 1 1 2 2 2 2 2 2 1 1 1 1 2 1 2 2 2 2 1 1 1 1 2 1 1 1 1 1 1 2 2 2 1 2 1 2 1 2 1 1 2 2 1 2 1 2 2 2 2 1 2 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 2 1 2 1 2 1 1 1 1 1 1 1 2...

output:

540530
356108
107560
603887
323002
476651
112201
44723
253728
214667
497566
244213
28678
257623
340095
558202
24730
51199
227266
376341
156239
276702
199874
42135
774009
237485
431880
388048
389491
430438
16250
534742
397227
450501
397590
193247
238377
175390
444601
209872
16453
35022
73567
700079
3...

result:

ok 500000 numbers

Test #15:

score: 0
Accepted
time: 797ms
memory: 60736kb

input:

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

output:

173801
55174599561
59336852818
4533186203
15457127359
20012503084
80485334154
46277796243
60292844742
128649338
34824082
13261610318
31830547069
57230719381
18095914614
2824927212
22004138995
80337358563
37445
24007335917
8344318568
12282226864
28477030102
43730336938
2740107926
9397039164
809401478...

result:

ok 500000 numbers

Test #16:

score: 0
Accepted
time: 784ms
memory: 61876kb

input:

500000
2 4 4 1 3 3 3 4 2 3 3 3 1 4 2 3 3 1 4 3 4 3 3 2 1 4 4 4 2 2 4 2 3 1 1 1 2 1 4 3 3 1 2 2 3 1 4 2 2 1 1 4 1 4 4 1 4 2 3 3 1 2 1 1 3 4 1 2 4 4 1 3 4 2 4 1 4 3 1 2 4 3 1 1 4 1 4 2 3 1 1 4 3 3 2 2 3 4 1 1 1 4 1 4 4 3 2 2 4 3 4 4 1 1 4 1 3 4 4 4 1 1 2 1 1 1 1 4 1 2 4 1 2 2 1 2 4 2 2 4 3 4 4 3 1 1 3...

output:

980395
346211
1566220
1239132
1922407
2377546
1351052
806505
66944
451953
43406
629669
2539532
778472
868743
653412
699643
277779
1042426
523399
871831
586514
884060
695846
146902
1244471
126569
653421
145726
1518327
372274
127419
1536219
1606849
274209
1084437
1434319
1462137
324478
1307998
967096
...

result:

ok 500000 numbers

Test #17:

score: 0
Accepted
time: 823ms
memory: 59324kb

input:

500000
3 5 1 5 4 5 2 1 3 4 2 1 5 1 1 2 3 4 2 1 4 1 5 2 4 1 2 1 3 3 1 3 1 3 2 2 5 5 3 5 4 3 4 4 3 3 5 2 2 3 3 3 5 1 2 2 1 4 2 4 4 2 5 5 1 1 5 1 1 2 2 1 1 2 5 3 2 1 2 5 3 1 4 5 2 4 1 1 4 1 1 2 5 3 3 5 3 2 4 4 2 2 2 5 2 3 3 1 4 5 3 4 3 2 4 3 2 1 2 5 2 5 2 5 2 4 4 5 5 2 2 4 3 3 5 5 2 2 4 4 2 5 1 2 5 4 1...

output:

97324936
30798350751
24994414509
17387367743
49163017853
18650913697
791571011
15594099165
92303159
729688203
2678084463
79581686686
28529875522
74878628779
1192863335
45519845966
9593872464
217710981
6666295408
18335321968
27587314526
8194412795
14848956850
23921365038
50959271593
240260282
2215509...

result:

ok 500000 numbers

Test #18:

score: 0
Accepted
time: 796ms
memory: 60600kb

input:

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

output:

494666
1168760
2529523
167462
1373484
1169061
1373085
78119
370985
1498857
1266636
3262359
4326871
1335958
2514467
1771036
234898
1642337
2053992
2629553
2020027
1548676
2153185
147679
546141
3521632
1301908
266860
246768
1509543
1478115
1416320
1483103
1563626
2792254
22562
1505404
4114080
1218275
...

result:

ok 500000 numbers

Test #19:

score: 0
Accepted
time: 785ms
memory: 59380kb

input:

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

output:

5418802
2453465
896971
525687
867233
797303
3160186
4919653
1689522
1249190
1870615
904243
3841470
5258260
1616579
3511940
1324919
1163704
706352
2642365
2389370
1158062
4481426
2472345
503223
837897
3100693
3445200
1538517
113246
675798
2748553
1836345
471025
3030168
4513870
760136
3263165
4599076
...

result:

ok 500000 numbers

Test #20:

score: 0
Accepted
time: 818ms
memory: 60632kb

input:

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

output:

9383305592
13530729766
18404629692
67309825116
5088130097
25835259103
45949197746
4756907349
2679801544
477626639
7026738692
22913276218
3805602318
25941726128
14199212942
22962766644
52367061427
18377190046
30687444281
32727914514
30049641522
4941121490
27869328997
85787936
12416717377
2270535771
2...

result:

ok 500000 numbers

Test #21:

score: 0
Accepted
time: 804ms
memory: 61716kb

input:

500000
3 10 10 3 2 5 7 10 10 1 1 4 2 10 3 9 4 1 8 1 9 5 1 8 3 1 3 7 6 10 7 8 5 8 5 3 6 5 1 9 9 10 4 6 7 9 6 10 2 9 1 8 1 8 4 6 8 4 3 6 7 2 4 5 2 3 7 9 6 8 5 5 8 6 8 8 10 2 5 5 6 5 5 10 1 10 5 6 5 3 3 8 6 7 4 8 7 3 1 5 8 8 10 6 1 1 6 4 6 9 1 10 3 6 3 3 6 4 10 2 1 5 4 1 7 5 1 4 8 4 6 3 2 8 9 10 6 2 1 ...

output:

7447164
5008023
2912700
6188542
7265404
4068446
6737942
14734
2857306
317232
2648631
2354796
923476
3543486
4707302
770253
5206011
2375822
8655160
4504369
3055261
101254
4578652
2313075
814442
7554520
1556462
4484676
3953234
1738500
1562228
2729550
4038254
723129
4255678
6005848
6465195
3364468
3491...

result:

ok 500000 numbers

Test #22:

score: 0
Accepted
time: 835ms
memory: 61908kb

input:

500000
17 16 2 12 20 14 18 13 3 11 2 10 1 7 8 15 12 3 6 15 16 10 7 12 1 16 13 12 4 7 6 13 2 16 14 10 2 14 7 12 10 16 1 6 14 10 7 9 1 5 4 17 14 19 2 18 16 3 15 3 14 15 10 15 8 7 19 7 4 5 13 9 6 4 1 4 16 8 13 6 3 9 19 8 16 15 18 10 15 11 16 12 16 1 11 10 9 4 19 6 18 14 14 16 9 1 1 8 18 15 12 16 8 7 17...

output:

10748761
11778
14853995
9310200
12052027
9931431
11107483
1306864
2698527
5299166
4341851
16495941
6390634
12998235
1003176
11393964
1011341
8435392
11797391
4877476
7576201
8144646
14869452
1736471
8250392
8789295
545265
14413
7101135
20915595
1286428
4258858
2449426
13873600
7734722
8781797
119316...

result:

ok 500000 numbers

Test #23:

score: 0
Accepted
time: 859ms
memory: 58360kb

input:

500000
40 27 13 47 47 2 36 36 1 26 47 37 10 33 13 38 9 12 5 17 31 1 3 33 19 26 35 50 42 14 1 30 24 41 18 32 43 18 10 18 45 38 43 35 28 37 19 36 30 36 16 35 3 20 31 16 50 44 13 30 37 33 39 29 13 18 29 13 10 32 18 10 42 39 47 45 11 39 49 13 29 8 6 20 34 30 28 27 35 8 4 8 30 8 41 6 17 44 9 43 17 13 28 ...

output:

18078368
7959836
23989936
22720089
23935628
44091383
28159030
57213400
3876585
15673642
34238508
6637939
30856015
15206517
11480469
27048400
38562695
11947225
4038254
12849434
47636286
54817343
6299024
6267001
19892250
32696312
34860484
677108
18890882
2814600
41555307
51967020
8849302
31031170
2103...

result:

ok 500000 numbers

Test #24:

score: 0
Accepted
time: 850ms
memory: 59452kb

input:

500000
10 1 22 62 37 77 74 33 81 9 67 20 26 3 83 60 36 63 83 44 99 28 58 29 95 9 66 100 89 65 24 22 92 19 16 5 61 26 55 32 99 11 87 35 100 98 75 28 58 40 33 63 47 76 74 95 18 85 85 39 20 86 92 87 52 50 9 36 10 12 22 23 92 73 22 46 76 73 70 93 23 49 96 19 62 24 32 10 8 89 90 55 49 31 9 68 38 29 31 32...

output:

31930744
19005886
64091856
6644240
16370638
817094
22809826
64585662
90991300
48047526
16514624
7949008
67197498
44165253
20670876
52001025
31847434
84803171
43898305
393813
52346603
45235639
76202514
19262592
41892869
27878892
61360940
29766099
92022512
92389409
83205556
23077268
34112369
24349206
...

result:

ok 500000 numbers

Test #25:

score: 0
Accepted
time: 883ms
memory: 60832kb

input:

500000
3 300 281 169 187 135 54 248 146 192 151 208 196 41 17 104 52 4 277 141 58 46 20 47 219 52 179 125 33 121 177 8 68 33 128 168 2 5 280 230 32 73 100 220 159 221 263 168 184 76 136 42 300 164 46 169 64 283 1 258 246 156 247 153 274 12 260 130 82 106 195 253 215 23 82 54 146 271 189 298 128 14 2...

output:

279199573
203237314
73718288
186538233
39289601
30184015
386736510
290651854
296733138
167784482
188441436
175936288
351996896
43217221
200364833
277699449
184162606
129538663
288346362
266454116
41245754
153386621
76244882
131466852
3176495
129227057
103226475
92791566
28110489
141993390
177445098
...

result:

ok 500000 numbers

Test #26:

score: 0
Accepted
time: 905ms
memory: 58848kb

input:

500000
343 354 55 126 256 222 38 204 328 236 94 98 230 264 334 27 210 22 121 386 236 156 296 104 228 69 340 241 303 239 352 295 105 46 125 198 173 343 387 30 255 358 255 309 147 328 303 386 242 289 184 35 316 360 81 360 81 38 309 69 167 395 133 84 40 297 388 129 16 359 281 268 323 207 16 11 133 224 ...

output:

261200221
181093107
607478950
126758028
182502728
82470778
182619446
285677717
244785498
540823227
74731076
205478686
98635689
168222962
292144469
219789755
312760556
193199420
51389269
142659635
486341342
474013002
537473249
181683817
473387084
133568863
94878691
617433079
88720702
115045392
144461...

result:

ok 500000 numbers

Test #27:

score: 0
Accepted
time: 966ms
memory: 61664kb

input:

500000
329 264 669 549 755 540 486 346 353 602 269 667 171 436 99 5 635 302 108 676 467 97 612 732 581 249 280 707 281 632 649 164 42 177 141 221 73 493 238 321 313 201 72 184 177 182 367 58 93 56 679 184 413 40 234 211 69 242 38 707 316 248 444 209 285 237 578 509 248 154 130 441 466 604 537 235 76...

output:

447883769
666866137
305320829
872890720
426181944
721752305
1100630584
50790884
190987391
561021461
91701099
179841777
387932805
875130674
954399142
526584646
272683641
731339456
376174579
71229625
189461220
101557143
41801864
1108452938
334805413
198830659
666458996
608728500
409248050
1069794475
8...

result:

ok 500000 numbers

Test #28:

score: 0
Accepted
time: 919ms
memory: 61760kb

input:

500000
406 570 697 403 414 943 609 728 822 572 41 615 788 424 808 207 481 686 692 694 10 860 666 244 850 109 455 390 446 199 914 459 807 550 583 154 636 503 613 459 21 870 265 513 609 856 809 534 129 762 58 391 882 72 467 668 775 910 816 146 141 843 863 1000 174 593 182 781 798 111 811 520 753 543 3...

output:

1775918555
1036805649
321689325
1044103
876303041
656051623
1260072174
227231734
1107724354
775379529
141132985
433065433
562375950
990019063
641477338
579277480
262118293
530574950
325418952
277722813
465217648
980246796
15035968
38248728
487811951
433241080
370654811
1232880976
27381681
118391464
...

result:

ok 500000 numbers

Test #29:

score: 0
Accepted
time: 996ms
memory: 59164kb

input:

500000
969 1006 2226 1484 1103 972 887 603 1443 2386 1969 1221 1398 2731 2228 1608 680 2296 472 181 1539 292 521 2995 1566 2454 890 490 1787 186 2453 1977 545 1448 2484 18 402 1892 2540 1280 910 1860 445 2495 1159 70 147 548 2899 1207 2440 129 173 588 207 1619 2892 1893 115 1060 2707 1533 2990 2153 ...

output:

3041263626
562132225
1326085646
4781949679
4201529944
562361604
2349285872
4187696259
2252490637
3011818485
887049473
666682977
3391698828
4503208128
1712103934
4137014864
12730168
2614958606
1431215181
667166333
1728954100
1188579747
609835172
24828181
1263965236
293356058
893743924
5530536701
3272...

result:

ok 500000 numbers

Test #30:

score: 0
Accepted
time: 989ms
memory: 59024kb

input:

500000
4341 4635 3858 3566 1089 298 2166 4989 4871 2200 4602 1723 2304 1935 4647 1112 3175 1394 4251 3476 172 1212 81 3042 4065 3903 1220 1887 4535 469 2184 4983 90 3835 4682 3881 3169 3497 2467 910 4799 2339 3136 1478 1605 3091 997 1562 2669 3756 2821 1867 872 4401 4244 4570 10 4388 3414 3974 1169 ...

output:

3217884011
1855086371
1365306167
5619215276
3208936293
5032274740
641744211
633486951
2699963778
2680913450
7775004408
8930115532
5529393429
9265257353
1630068094
1897170004
3731076850
4058317412
9159014585
4453052653
387893145
7818727466
3033966638
177077500
5940961593
5297056425
4489884090
5503647...

result:

ok 500000 numbers

Test #31:

score: 0
Accepted
time: 997ms
memory: 59068kb

input:

500000
2608 479 6387 647 74 3135 3253 5672 788 118 2018 2225 1403 2434 1066 3321 4670 1493 31 4259 5404 4940 6832 601 77 6056 2847 5284 4284 48 1723 2693 828 6030 1583 2744 3423 6885 3289 2436 5688 6626 2124 4756 347 1304 6846 2576 3248 5602 6203 5605 2571 5917 6576 3417 2423 6371 2713 5480 5630 401...

output:

4632553923
909476499
296021083
14248996983
7454893083
4211316184
196812242
4452434462
10992489115
2497570472
54778490
2706033961
3810503281
228240153
7760304910
7426556118
5545155700
1015484878
4496094379
9750681501
13285998691
3964540358
7035333343
8973171246
2374873
10989064910
745401105
426683458...

result:

ok 500000 numbers

Test #32:

score: 0
Accepted
time: 1000ms
memory: 62204kb

input:

500000
8164 8948 9815 556 1609 8090 6868 1115 2754 4728 6531 4439 2428 1200 1523 4051 5577 9273 983 5240 6652 571 3526 3314 4049 2134 8812 7584 690 4843 7384 6664 19 5329 5804 5840 3127 8034 5376 3414 9256 187 9136 5850 707 9151 5193 9487 1081 7077 3008 2157 5920 5894 2331 6338 5488 2752 6581 348 56...

output:

405370036
5654462674
3540023494
813365496
985562799
8293906404
143892010
2033821353
158183302
2241435209
439107915
20599767508
3909907132
3965056446
3382514268
14673554358
1387741076
2168258437
9166462099
173844846
11109148829
3953006412
581537387
5187343
1311706730
16960881374
16361856225
759526441...

result:

ok 500000 numbers

Test #33:

score: 0
Accepted
time: 1045ms
memory: 61936kb

input:

500000
1422 1129 19069 13525 3593 2078 3727 18002 5898 11768 6621 872 4239 9117 6141 5801 3595 13513 8923 8826 4162 2250 7383 2034 8270 16995 8933 7454 9916 10922 9675 96 14831 13033 3238 15915 3068 18144 1477 7337 13549 4641 13132 6933 10623 13395 13107 2145 4195 10321 16101 13682 6112 1640 1218 56...

output:

6554429351
28476463776
1874354045
10412811271
3500570996
872180071
20752891374
5548561268
31374374967
6482471056
10597342411
12004436283
2209046008
1789878862
2862859
16522801462
30165286649
10678771369
33359461814
8172300810
15448685971
12276865347
160899398
2352825372
24098998200
555783
1333693909...

result:

ok 500000 numbers

Test #34:

score: 0
Accepted
time: 1113ms
memory: 61956kb

input:

500000
34171 26458 39934 21343 20630 34042 8898 548 17217 999 28108 36380 42105 35573 3500 8076 3057 27452 17065 30671 2498 36888 15850 31171 30933 35770 27678 10169 29083 47541 9652 45801 8054 42642 27427 36140 44781 1580 28164 34784 19404 709 43507 7080 23761 10719 8065 41738 26240 24372 33765 446...

output:

17895821757
389115020
17697048406
51670639867
610498928
456744203
164376107
325634893
263119938
10689715529
66577218
89917201
11321974041
3635543264
9763012636
6868772193
994493563
379410906
7321396185
172632316
89037827
812374622
10225709494
9653087593
36520397051
866288022
14405800660
275528695
11...

result:

ok 500000 numbers

Test #35:

score: 0
Accepted
time: 1007ms
memory: 59160kb

input:

500000
37433 34631 59460 66333 94471 89824 45355 63164 42017 68601 45726 50801 46150 89634 40774 21988 77799 9981 80321 53555 64589 15779 46237 7473 83152 26431 24514 87041 65825 18129 47621 44767 99553 11596 50454 52023 55304 84792 31699 73836 29631 8561 31314 27667 1574 85574 58299 40661 83599 549...

output:

1297915239
7054441558
1446083524
552223071
6513448078
1931131223
167584150
5718372994
42331044255
798198397
10942936
24345332151
2390427278
2086153123
451793335
406322787
382591199
910946205
9673762223
334469633
7575611249
46903984188
32055319467
4232974245
7603064455
17199656695
21357458600
3691772...

result:

ok 500000 numbers

Test #36:

score: 0
Accepted
time: 836ms
memory: 60840kb

input:

500000
247202 198984 54919 39200 280338 231678 193424 286806 84941 124651 350538 117509 307852 161768 366679 430979 52700 429733 165103 457717 58236 308194 167035 13496 398946 342389 53307 363131 321687 143399 334849 290754 214134 326295 292180 359749 180593 103541 415854 169806 437100 7240 261279 3...

output:

503642417
7472397984
4277819126
1402238077
17659746177
736607632
3315056127
399300504
12764464489
1668519290
27214415995
306775483
24640547914
9650106525
21086493860
598952598
17774763818
35354920
21832983820
3121003918
1932438747
3125825
2401
2733515007
4034219265
35934450823
540004204
2384756769
1...

result:

ok 500000 numbers

Test #37:

score: 0
Accepted
time: 732ms
memory: 58948kb

input:

500000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

91572099081
52857196953
87593097628
73103599635
68909383180
88175431711
86295404520
70227962925
54779672503
95496080851
94815536311
103226730006
63631892170
62409915051
60101658456
77537841706
98905506420
75735011836
70787863245
51536069676
70621651576
65697506370
57210082930
75459714886
87786575605...

result:

ok 500000 numbers

Test #38:

score: 0
Accepted
time: 700ms
memory: 60676kb

input:

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

output:

74447250121
75798463349
84180225742
94242028795
58882310514
79459119761
73998392170
59102831065
65509874196
119887132200
85353278883
85473139279
80739100507
66239811944
60146392107
53499332225
70041451030
82121687327
92365524649
74754332228
74491632476
48321478195
73901094058
92270563374
84321024282...

result:

ok 500000 numbers

Test #39:

score: 0
Accepted
time: 726ms
memory: 58612kb

input:

500000
3 10 10 3 2 5 7 10 10 1 1 4 2 10 3 9 4 1 8 1 9 5 1 8 3 1 3 7 6 10 7 8 5 8 5 3 6 5 1 9 9 10 4 6 7 9 6 10 2 9 1 8 1 8 4 6 8 4 3 6 7 2 4 5 2 3 7 9 6 8 5 5 8 6 8 8 10 2 5 5 6 5 5 10 1 10 5 6 5 3 3 8 6 7 4 8 7 3 1 5 8 8 10 6 1 1 6 4 6 9 1 10 3 6 3 3 6 4 10 2 1 5 4 1 7 5 1 4 8 4 6 3 2 8 9 10 6 2 1 ...

output:

6970713
6258582
6192713
8236078
7141657
6674475
6722817
6114309
7242369
6776405
7830229
7248710
7306907
6676174
7015288
7043649
7211409
6670307
5702031
6026574
7186661
7101835
7487116
8082505
8325595
5803608
8094982
7362267
7082750
7693386
8261066
7714967
6338761
7392067
7631843
7979026
7493566
7990...

result:

ok 500000 numbers

Test #40:

score: 0
Accepted
time: 730ms
memory: 57208kb

input:

500000
17 16 2 12 20 14 18 13 3 11 2 10 1 7 8 15 12 3 6 15 16 10 7 12 1 16 13 12 4 7 6 13 2 16 14 10 2 14 7 12 10 16 1 6 14 10 7 9 1 5 4 17 14 19 2 18 16 3 15 3 14 15 10 15 8 7 19 7 4 5 13 9 6 4 1 4 16 8 13 6 3 9 19 8 16 15 18 10 15 11 16 12 16 1 11 10 9 4 19 6 18 14 14 16 9 1 1 8 18 15 12 16 8 7 17...

output:

15912994
17167879
17343524
16107675
20458239
19333359
15864015
17214125
14027647
16831298
19552824
18016504
16710399
16455287
14970653
16525499
16092172
13721700
18614707
15417878
15001339
15606032
15462378
17313831
16972202
18007681
18879896
17733550
18588145
15158939
16553918
15077810
14607765
168...

result:

ok 500000 numbers

Test #41:

score: 0
Accepted
time: 747ms
memory: 57136kb

input:

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

output:

32701457
40244383
30665133
46300761
34831331
43514138
43609241
40003490
41134748
45307930
38702201
34978997
31391499
37620538
42661503
35075425
31405967
43470588
44920268
37919860
41173669
44787980
47552542
33949455
37221799
32753355
38952347
41353782
36954022
37604002
41285546
39159405
36804668
408...

result:

ok 500000 numbers

Test #42:

score: 0
Accepted
time: 820ms
memory: 57168kb

input:

500000
406 570 697 403 414 943 609 728 822 572 41 615 788 424 808 207 481 686 692 694 10 860 666 244 850 109 455 390 446 199 914 459 807 550 583 154 636 503 613 459 21 870 265 513 609 856 809 534 129 762 58 391 882 72 467 668 775 910 816 146 141 843 863 1000 174 593 182 781 798 111 811 520 753 543 3...

output:

1508130235
1709326291
1627204854
1781012953
1469120604
1901674169
1411656462
1777728441
1531120790
1788696399
1651022784
1420746615
1742515687
1815222344
1512571039
1671489178
1472376242
1413348171
1617218890
1520220400
1648996891
1410233299
1718497977
1489150720
1544526189
1589737431
1771967449
162...

result:

ok 500000 numbers

Test #43:

score: 0
Accepted
time: 933ms
memory: 56772kb

input:

500000
8164 8948 9815 556 1609 8090 6868 1115 2754 4728 6531 4439 2428 1200 1523 4051 5577 9273 983 5240 6652 571 3526 3314 4049 2134 8812 7584 690 4843 7384 6664 19 5329 5804 5840 3127 8034 5376 3414 9256 187 9136 5850 707 9151 5193 9487 1081 7077 3008 2157 5920 5894 2331 6338 5488 2752 6581 348 56...

output:

16424783642
19059868595
21623677774
17894631296
18271716693
17685419758
16809805829
20962083937
19133908952
19062348669
20194236157
20022176651
17807982721
18045579980
14963771167
18867155032
20859921419
15936977964
19804738159
20816343512
17754624185
14725588329
18809658179
15661754596
18376671443
...

result:

ok 500000 numbers

Test #44:

score: 0
Accepted
time: 1004ms
memory: 56944kb

input:

500000
37433 34631 59460 66333 94471 89824 45355 63164 42017 68601 45726 50801 46150 89634 40774 21988 77799 9981 80321 53555 64589 15779 46237 7473 83152 26431 24514 87041 65825 18129 47621 44767 99553 11596 50454 52023 55304 84792 31699 73836 29631 8561 31314 27667 1574 85574 58299 40661 83599 549...

output:

38766761399
43900282922
44335043488
23020641292
31231004617
24029266993
36924191331
46108857935
42183694913
35331542782
38233896277
33038214462
29716466424
31488781439
45368373778
34384452824
33899989563
53280767779
33303918845
40344303159
41011750266
45630014476
40573537091
32346196122
49243853377
...

result:

ok 500000 numbers

Test #45:

score: 0
Accepted
time: 832ms
memory: 57512kb

input:

500000
247202 198984 54919 39200 280338 231678 193424 286806 84941 124651 350538 117509 307852 161768 366679 430979 52700 429733 165103 457717 58236 308194 167035 13496 398946 342389 53307 363131 321687 143399 334849 290754 214134 326295 292180 359749 180593 103541 415854 169806 437100 7240 261279 3...

output:

36961618629
49607159845
38062425287
29154532758
40751061173
27123110115
42296072384
53827271625
53771863511
43663007350
39387781771
49018201910
34425108290
22764587636
41248190029
38507422926
45140182191
47362657999
42453752676
25209309898
34043392949
41624436757
49015552664
38390664676
43328457267
...

result:

ok 500000 numbers

Test #46:

score: 0
Accepted
time: 877ms
memory: 56388kb

input:

500000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

19243786653
2964384501
18458793730
38442237840
56864902941
79641003651
710965486
1531285470
2226012726
38746737876
6313789378
3140003881
2610139626
11859001021
34278914530
69543321
284637870
3231637815
3939390703
1241539365
14615797878
932623266
2980267410
5628870253
42140790
43367922795
5156353576
...

result:

ok 500000 numbers

Test #47:

score: 0
Accepted
time: 902ms
memory: 57592kb

input:

500000
2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2...

output:

62592
330975
161578
2205
207264
67093
11365
467068
99590
111894
27792
313417
68602
15356
291021
212236
77285
12095
16985
87637
231043
136054
174308
50830
171331
159815
17282
400938
85470
13411
300238
217490
251242
181573
266283
296827
404409
67041
160515
208410
277765
67739
59187
152853
158756
10944...

result:

ok 500000 numbers

Test #48:

score: 0
Accepted
time: 899ms
memory: 56932kb

input:

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

output:

4721150207
37770024436
116930279
7552635157
89342083406
1646662579
157078951
40994009281
93723067726
58541611
276936346
3223282196
8005742917
106041407551
60417572692
1491535654
511216301
1579529116
3843058286
2199005404
12252933697
391398232
1114935032
39270171376
76327738117
13737111382
1424933652...

result:

ok 500000 numbers

Test #49:

score: 0
Accepted
time: 861ms
memory: 57364kb

input:

500000
2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4...

output:

328908
266254
289632
421798
170774
450760
568854
593266
800164
694298
167850
142710
260370
805640
75728
91324
138332
183600
384650
527026
107964
746800
774860
459772
94498
408790
89086
139226
878124
63408
179490
388616
74410
516498
103728
458908
54580
301494
30070
376150
761666
497944
559286
59428
3...

result:

ok 500000 numbers

Test #50:

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

input:

500000
2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3...

output:

26851134456
16761614874
1078249
266470158
862598883
35722105698
32420382844
37599812428
2269931134
181899204
25107603831
441535189
67038952864
27251435614
112342558
3900343684
20606834569
57765835053
44098411713
40564776531
35964413113
569008248
119575383
5963029824
1127911263
4819607113
395184444
4...

result:

ok 500000 numbers

Test #51:

score: 0
Accepted
time: 892ms
memory: 56732kb

input:

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

output:

700836
194160
443259
1166754
1136574
96036
240645
744537
469944
442221
420171
512112
412443
635124
974217
336204
489426
338448
196980
1057896
205224
79278
525765
358026
343962
276720
1031622
588903
781791
132342
460350
412152
432378
1167792
86799
429513
572220
1165086
2706
377526
61551
393264
219042...

result:

ok 500000 numbers

Test #52:

score: 0
Accepted
time: 889ms
memory: 56012kb

input:

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

output:

19820504556
48218943246
53380003917
2943708091
23366788116
20278261197
90798715159
36607985826
108110407516
725062246
11914816902
95280748317
14007948516
16990156959
4023089856
59932932442
57057629151
69767584
91721087457
1540374766
114222641826
5501847657
3053672181
2052514491
198194101
1436346009
...

result:

ok 500000 numbers

Test #53:

score: 0
Accepted
time: 879ms
memory: 57812kb

input:

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

output:

238672
1181084
788872
45048
1524340
1364076
626780
68728
363644
425796
187636
1321348
393288
70892
880184
452272
815852
95120
191348
5920
434596
1185904
690124
166008
168512
321452
294028
151124
1785860
1198508
1324952
642256
436528
1174696
154824
303192
963816
682296
1039772
917436
771620
1312036
1...

result:

ok 500000 numbers

Test #54:

score: 0
Accepted
time: 888ms
memory: 58692kb

input:

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

output:

12744779695
6350250566
17897847013
52309466086
2923562821
53454200006
1868469025
23684413
5074021963
33740096575
8572445401
83082505
4481535811
688371970
25786183070
5419706338
699885001
83197935496
1613886901
5423975791
59504392786
63594796576
27163259750
94744505
9367040638
69920984045
3043833286
...

result:

ok 500000 numbers

Test #55:

score: 0
Accepted
time: 909ms
memory: 56956kb

input:

500000
2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1...

output:

1197520
861970
817950
303700
825030
1579870
323645
1663255
873320
692720
235805
767400
318475
1402055
567415
352740
16420
1570295
350330
1189745
1163380
1559575
801325
117705
1226500
1256970
1039700
486025
641405
1405200
1942810
1256890
17830
1176125
199575
1872885
1703245
455985
1179875
1128385
777...

result:

ok 500000 numbers

Test #56:

score: 0
Accepted
time: 882ms
memory: 56584kb

input:

500000
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1...

output:

325710
1561420
191860
2605070
1852600
1843600
821580
2493390
3343210
2040410
2048780
1601670
697170
116310
429950
192790
1066660
644960
781200
2232270
1076980
134770
713080
474700
1662280
2871790
234670
2947360
2557450
303440
1442530
2891470
189730
2913200
3291110
1680080
1837740
2615950
4393400
699...

result:

ok 500000 numbers

Test #57:

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

input:

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

output:

747435
2098365
1387335
3467790
4584885
3464310
907845
3078810
5433360
415815
3057195
2615040
3046995
5888685
1029915
970020
1094265
2058570
3885225
518595
1602945
1925940
3446865
2551530
4301055
749265
3820095
374565
2592135
1883070
215835
317520
515685
1466730
4253340
977730
2468460
1019715
2631150...

result:

ok 500000 numbers

Test #58:

score: 0
Accepted
time: 895ms
memory: 58648kb

input:

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

output:

4216600
8762325
2636800
7473175
2976300
8032925
935100
1632550
3555600
9292225
7376425
7184925
66750
697800
1441375
606400
1930250
1806025
2202550
6111725
6373000
6981725
5015900
10729000
8787075
3177700
1112750
362800
4615825
6352750
7703075
3373425
4781800
5086075
1292625
1134625
2609350
1709475
3...

result:

ok 500000 numbers

Test #59:

score: 0
Accepted
time: 932ms
memory: 57292kb

input:

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

output:

1272150
4515600
11284600
21369650
13091200
9034950
12361450
5091450
11783950
17854550
19786150
7529050
8781900
3109300
14501400
7212500
10521250
2937050
15044350
14076450
8592000
13005000
187700
175250
8671700
10416100
5581150
5763650
375950
15544900
12224300
3637850
21067700
5778950
2817700
2246255...

result:

ok 500000 numbers

Test #60:

score: 0
Accepted
time: 944ms
memory: 57188kb

input:

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

output:

24270300
9661400
25676400
17717500
25969500
5950100
39106900
40158400
14641800
9023700
21174900
32145100
10822900
35158800
933400
16770800
37229800
20098400
8883400
25963100
6716800
15959100
2493200
14563700
9015700
6112500
15020100
9687600
30819100
3914000
4989400
11725900
11907600
12471100
1478900...

result:

ok 500000 numbers

Test #61:

score: 0
Accepted
time: 948ms
memory: 55976kb

input:

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

output:

47918250
47451000
10335000
10911900
27479700
16246350
2399550
1314750
33015000
9973200
42066000
30918750
57497850
12435900
2736000
36417450
6688050
39463800
33263250
52875300
47926650
37369800
23458500
3067050
14136600
5123700
5267400
6866250
17254950
32011350
10284300
31388700
19693500
27933300
129...

result:

ok 500000 numbers

Test #62:

score: 0
Accepted
time: 925ms
memory: 57900kb

input:

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

output:

88922600
4454600
34113600
71113600
65498800
30199600
67953600
41781800
13918000
8547400
48024400
1762000
26392200
10060200
7573200
40131800
37172200
7175000
22314400
21169000
2979800
25069600
12716600
24263800
10929800
5750200
12369200
12016200
5311800
9448400
17446000
11630600
31531800
13532200
762...

result:

ok 500000 numbers

Test #63:

score: 0
Accepted
time: 919ms
memory: 56120kb

input:

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

output:

23304300
11303700
4133400
90715500
124463700
35639700
21240000
117061800
11803500
65829000
28223100
62988600
28305900
33727800
39527700
20766300
333600
72067800
61893300
18177000
33286500
42160800
119150700
23987700
69706500
8724300
77405700
75578100
9085500
6792000
72477000
19336500
67079100
761142...

result:

ok 500000 numbers

Test #64:

score: 0
Accepted
time: 942ms
memory: 57160kb

input:

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

output:

56669000
123104000
12515500
72310500
4376000
177038000
87069000
17051500
111853500
84752000
87826000
69540000
84380500
10218500
12627500
150478500
49879500
75965500
9317500
21674000
198175500
110375000
157374500
118888500
65067500
100417500
166346000
96150500
7183500
10586000
96400000
24819500
76460...

result:

ok 500000 numbers

Test #65:

score: 0
Accepted
time: 972ms
memory: 58668kb

input:

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

output:

364711000
231932000
61104000
132393000
104751000
456293000
216339000
192561000
157847000
262606000
216304000
70675000
270781000
33034000
21073000
122063000
307581000
30450000
308789000
106102000
102645000
153245000
225741000
172361000
175788000
327569000
194304000
194413000
367870000
267992000
96914...

result:

ok 500000 numbers

Test #66:

score: 0
Accepted
time: 1026ms
memory: 57028kb

input:

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

output:

169490000
156985000
629277500
136697500
550432500
88452500
167832500
209917500
76802500
95692500
858855000
323852500
130850000
220422500
421090000
424257500
409392500
904252500
105435000
77362500
75105000
564610000
772470000
667342500
646472500
28870000
227577500
192940000
617200000
1054855000
13341...

result:

ok 500000 numbers

Test #67:

score: 0
Accepted
time: 1043ms
memory: 56552kb

input:

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

output:

964708500
513667000
1118043500
1518723500
282912000
95532500
1195148500
1042149500
688376500
221459000
224133000
744565500
36683500
34786500
296583000
453152000
652050000
359320500
269374000
569271500
764540000
591045000
596907500
650202000
1350496000
1141350000
137046000
102700500
827939000
1934415...

result:

ok 500000 numbers

Test #68:

score: 0
Accepted
time: 961ms
memory: 57248kb

input:

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

output:

328930000
678715000
207415000
1696245000
715140000
514550000
968870000
837650000
1393490000
353725000
394605000
626070000
1684585000
1718870000
445775000
21538881
1151560000
1525190000
2050475000
834820000
429665000
741440000
132790000
503540000
2095030000
1220755000
275140000
1045045000
688690000
6...

result:

ok 500000 numbers

Test #69:

score: 0
Accepted
time: 981ms
memory: 57320kb

input:

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

output:

4097090000
7689529
315170000
2042770000
4041320000
1242530000
57183844
1296620000
1399200000
499050000
1719140000
3153510000
31792682
1485230000
3510080000
3795810000
2518000000
3173250000
2450780000
8590761
1410940000
162010000
2872300000
30052324
1838760000
1475830000
1055300000
60505062
222277000...

result:

ok 500000 numbers

Test #70:

score: 0
Accepted
time: 1037ms
memory: 58728kb

input:

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

output:

5817875000
3589825000
4710350000
4583800000
65772100
2918250000
4211750000
4489450000
148803402
8465200000
295702416
4758075000
6754125000
2312775000
1413600000
5278775000
2739750000
2907225000
2045025000
10962721
87394452
7785725000
341510400
66659060
579220489
1357600000
9578625000
3498650000
2504...

result:

ok 500000 numbers

Test #71:

score: 0
Accepted
time: 965ms
memory: 60664kb

input:

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

output:

2361960000
7843750000
2732450000
3390550000
3829300000
12753850000
5325900000
3439400000
1149888100
1340877924
4940600000
4438300000
804374682
977468960
568774801
2039184
11897950000
617010
1243056049
443923830
111007296
7682450000
64016001
3382000000
16405100000
2517450000
14578800000
89397025
2613...

result:

ok 500000 numbers

Test #72:

score: 0
Accepted
time: 762ms
memory: 58916kb

input:

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

output:

581292100
61787460
591997561
2180142864
394260736
13575861740
5335279849
1033686801
35538847806
21406030864
15620000400
5893709670
799730120
23998037569
7946831025
486136352
3145134642
1141460010
1484329729
15135150625
46195334761
3879919521
1023328110
15009067632
12535713369
6490719225
1575573942
1...

result:

ok 500000 numbers