QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#299504#2410. Average RankC1942huangjiaxuAC ✓216ms15940kbC++14843b2024-01-06 22:02:332024-01-06 22:02:34

Judging History

This is the latest submission verdict.

  • [2024-01-06 22:02:34]
  • Judged
  • Verdict: AC
  • Time: 216ms
  • Memory: 15940kb
  • [2024-01-06 22:02:33]
  • Submitted

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e6+5;
int n,q,p[N],ct[N],lc[N],a[N],m,rk[N],d[N];
ll ad[N],ans[N];
void solve(int t){
	scanf("%d",&m);
	for(int i=1;i<=m;++i)scanf("%d",&a[i]);
	for(int i=1;i<=m;++i)--d[p[a[i]]];
	for(int i=1;i<=m;++i){
		int x=a[i];
		ans[x]-=1ll*rk[x]*(q-t);
		rk[x]+=ct[p[x]]-lc[x]-d[p[x]+1];
		ans[x]+=1ll*rk[x]*(q-t);
		ans[x]+=1ll*t*(ct[p[x]]-lc[x])-ad[p[x]];
	}
	for(int i=1;i<=m;++i){
		int x=a[i];
		++ct[p[x]],ad[p[x]]+=t;
	}
	for(int i=1;i<=m;++i){
		int x=a[i];
		++p[x];
		lc[x]=ct[p[x]],ans[x]+=ad[p[x]];
		++d[p[x]];
	}
}
int main(){
	scanf("%d%d",&n,&q);
	d[0]=n;
	for(int i=1;i<=q;++i)solve(i-1);
	for(int i=1;i<=n;++i){
		ans[i]+=1ll*q*(ct[p[i]]-lc[i])-ad[p[i]];
		printf("%.12Lf\n",(long double)ans[i]/q+1);
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 7872kb

input:

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

output:

1.333333333333
3.000000000000
1.000000000000
2.000000000000

result:

ok 4 numbers

Test #2:

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

input:

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

output:

2.250000000000
18.050000000000
3.400000000000
13.925000000000
3.425000000000
5.125000000000
13.675000000000
3.650000000000
8.775000000000
15.375000000000
9.150000000000
8.100000000000
7.075000000000
8.400000000000
6.250000000000
16.300000000000
4.125000000000
7.125000000000
9.075000000000
9.40000000...

result:

ok 20 numbers

Test #3:

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

input:

3 2
2 1 2
2 1 3

output:

1.000000000000
1.500000000000
2.500000000000

result:

ok 3 numbers

Test #4:

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

input:

1 1
1 1

output:

1.000000000000

result:

ok found '1.0000000', expected '1.0000000', error '0.0000000'

Test #5:

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

input:

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

output:

1.833333333333
1.000000000000
1.166666666667
3.166666666667
3.166666666667

result:

ok 5 numbers

Test #6:

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

input:

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

output:

1.800000000000
2.100000000000
1.200000000000
4.200000000000
4.800000000000
5.100000000000
3.400000000000
4.500000000000
3.400000000000
2.500000000000

result:

ok 10 numbers

Test #7:

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

input:

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

output:

5.172413793103
14.275862068966
12.103448275862
11.896551724138
20.206896551724
14.482758620690
16.103448275862
6.172413793103
17.931034482759
22.103448275862
16.137931034483
12.689655172414
1.206896551724
7.241379310345
12.965517241379
17.827586206897
7.965517241379
8.068965517241
14.586206896552
11...

result:

ok 31 numbers

Test #8:

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

input:

3 1
0

output:

1.000000000000
1.000000000000
1.000000000000

result:

ok 3 numbers

Test #9:

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

input:

5 6
2 3 5
2 3 1
0
3 3 5 2
3 5 4 2
2 3 4

output:

3.166666666667
3.333333333333
1.000000000000
3.833333333333
1.666666666667

result:

ok 5 numbers

Test #10:

score: 0
Accepted
time: 187ms
memory: 13872kb

input:

300000 300000
150000 152378 20536 230896 243531 130262 222665 146584 12680 200961 255680 2766 29860 293060 200643 182208 86955 290788 137148 79258 187602 223959 170916 247928 46417 10375 136965 171609 213627 82670 98292 163902 213617 207226 53553 128847 234468 29348 152905 210512 265156 144800 22868...

output:

1.500000000000
99999.999996666667
99999.500000000000
99999.499996666667
1.999996666667
1.500000000000
1.000000000000
1.499996666667
1.999996666667
99999.999996666667
99999.499996666667
99999.999996666667
99999.999996666667
99999.999996666667
99999.999996666667
99999.500000000000
99999.499996666667
1...

result:

ok 300000 numbers

Test #11:

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

input:

300000 300000
299999 7032 158227 7678 209203 266354 200085 253883 166008 250138 90371 66885 207467 228752 19269 286178 296729 71542 207097 127135 214555 149659 129563 148687 49276 268491 32212 20362 217347 133993 61093 270529 144881 211539 232955 131129 13058 242480 34936 209410 23922 156572 96427 2...

output:

1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
...

result:

ok 300000 numbers

Test #12:

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

input:

300000 300000
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

output:

1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
...

result:

ok 300000 numbers

Test #13:

score: 0
Accepted
time: 207ms
memory: 13788kb

input:

300000 300000
299999 71033 247962 54677 261990 9654 217040 88445 1037 105117 58162 221454 10948 92280 229918 30197 47441 14956 261154 223658 105679 121570 13317 279910 226256 61552 264443 11177 262478 244700 275323 30774 1887 94319 70218 256870 33889 92135 279991 17428 141520 260437 17508 282396 202...

output:

44955.895026666667
24980.858506666667
100613.486030000000
107691.577626666667
162046.508326666667
184146.395066666667
151506.190223333333
55293.634926666667
148521.381500000000
5955.759693333333
169675.960706666667
162650.152970000000
28009.593676666667
97567.917480000000
31344.744673333333
115841.9...

result:

ok 300000 numbers

Test #14:

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

input:

2 300000
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0...

output:

1.000000000000
1.000003333333

result:

ok 2 numbers

Test #15:

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

input:

310 290
4 99 168 59 270
9 146 232 41 198 142 186 82 30 161
9 161 191 151 269 55 56 127 39 165
5 264 206 209 201 9
5 23 90 111 271 218
6 47 276 100 146 310 273
3 180 42 72
4 162 192 89 170
1 251
7 105 78 185 88 100 304 20
5 2 65 123 296 131
4 108 235 65 131
2 289 42
11 45 113 227 303 222 291 171 18 5...

output:

142.251724137931
47.579310344828
168.979310344828
137.575862068966
78.062068965517
118.775862068966
93.393103448276
106.575862068966
141.806896551724
197.606896551724
99.762068965517
64.610344827586
179.706896551724
73.568965517241
176.300000000000
148.775862068966
62.931034482759
104.800000000000
7...

result:

ok 310 numbers

Test #16:

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

input:

1765 794
40 1326 319 110 1071 1163 1029 603 467 1351 318 902 1143 796 1482 1761 262 345 969 866 1256 572 1441 1078 1362 812 1355 1155 1239 1203 1440 435 357 1049 1670 1667 422 1455 89 1198 1094
30 422 261 1441 52 568 1276 869 584 1502 435 1198 1094 1703 572 157 134 257 1159 128 635 357 1570 35 1113 ...

output:

1078.278337531486
615.299748110831
1314.186397984887
1424.249370277078
454.081863979849
940.326196473552
677.192695214106
430.023929471033
289.345088161209
631.629722921914
792.032745591940
26.085642317380
665.974811083123
283.227959697733
1067.808564231738
444.245591939547
1179.739294710327
879.348...

result:

ok 1765 numbers

Test #17:

score: 0
Accepted
time: 25ms
memory: 11608kb

input:

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

1.000000000000

result:

ok found '1.0000000', expected '1.0000000', error '0.0000000'

Test #18:

score: 0
Accepted
time: 73ms
memory: 15940kb

input:

300000 1
300000 49768 155480 28861 97552 227184 37757 100849 63219 47794 64854 251728 122056 2801 134528 204772 133045 165499 11257 204257 138807 75117 6823 37823 132760 83446 268187 181730 3612 249343 25649 280441 195002 76101 116736 144375 45713 183801 29935 22987 135773 290568 89307 195031 177754...

output:

1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
...

result:

ok 300000 numbers

Test #19:

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

input:

300000 300000
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

output:

1.603803333333
1.603803333333
1.603803333333
1.603803333333
1.603803333333
1.603803333333
1.603803333333
1.603803333333
1.603803333333
1.603803333333
1.603803333333
1.603803333333
1.603803333333
1.603803333333
1.603803333333
1.603803333333
1.603803333333
1.603803333333
1.603803333333
1.603803333333
...

result:

ok 300000 numbers

Test #20:

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

input:

100000 10000
96 1544 54337 51952 75699 54387 41720 98690 8105 89737 19401 25982 72872 53321 13606 23186 96215 28571 63276 58554 11026 78812 91506 47050 67720 8530 67857 8652 81109 8505 43952 61378 59487 88498 8180 77934 3207 97647 63732 3070 16008 95642 14028 63502 10091 1705 27285 50977 93423 81696...

output:

53336.605900000000
18470.065100000000
49956.625000000000
26444.026500000000
53496.491600000000
32049.234900000000
45075.936100000000
31798.455000000000
34686.029700000000
18832.384000000000
42392.216800000000
76710.109100000000
56593.757200000000
37206.066400000000
32208.946800000000
63398.448500000...

result:

ok 100000 numbers

Test #21:

score: 0
Accepted
time: 216ms
memory: 13820kb

input:

300000 300000
5 157356 169216 18305 108007 3918
2 205587 67014
2 115998 156445
3 128155 3313 217830
2 86595 294117
3 179919 112643 139659
1 5741
4 238037 197089 182186 117205
5 112778 185124 21090 262456 275381
6 83026 205000 182707 89512 198435 11251
4 291125 239325 280964 159617
6 211325 161480 89...

output:

213950.966403333333
148990.942866666667
104996.991790000000
70147.518853333333
41451.017466666667
127813.840343333333
58572.240803333333
78815.623733333333
34028.539386666667
28106.737600000000
159668.739680000000
132310.994460000000
54541.279070000000
181005.648666666667
56311.433330000000
134421.1...

result:

ok 300000 numbers

Test #22:

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

input:

100000 10000
90 80838 29211 2147 49644 56197 18473 11030 23767 83262 60875 84370 41533 90913 38305 84261 7862 34797 89005 67747 32187 98023 80692 43911 48990 86686 49171 67043 94639 24874 53132 12337 59797 94192 14415 53884 98079 70111 81342 46838 31370 28128 99843 59900 66576 6199 43302 45951 37351...

output:

51504.055000000000
12665.654600000000
63130.368600000000
40691.264100000000
64652.362600000000
66407.780800000000
53226.754400000000
33905.458600000000
24120.608500000000
33142.727300000000
33318.230000000000
29488.050900000000
13236.130000000000
60599.370900000000
48376.616300000000
25337.541400000...

result:

ok 100000 numbers

Test #23:

score: 0
Accepted
time: 208ms
memory: 14928kb

input:

300000 300000
5 226400 220239 74825 172235 2996
5 299606 87615 129599 190350 77047
2 9338 135432
5 60859 4714 280222 235596 258967
3 8462 167912 87615
4 278168 279730 285242 87615
2 111500 59917
2 135441 234907
5 268987 264905 92696 141219 87615
2 287419 87615
4 274811 87615 296765 94834
4 120991 28...

output:

96274.950873333333
16869.459463333333
96274.950873333333
96274.950873333333
59268.540103333333
96274.950873333333
10570.184110000000
96274.950873333333
39354.946963333333
96274.950873333333
60554.880190000000
96274.950873333333
96274.950873333333
52343.267843333333
35412.498910000000
64512.958016666...

result:

ok 300000 numbers

Test #24:

score: 0
Accepted
time: 201ms
memory: 14768kb

input:

300000 300000
2 297956 28538
3 83232 136045 169110
3 15593 126207 222941
3 190651 57624 131636
5 164816 215083 153334 289804 296131
4 126207 256111 165409 95552
4 14040 118877 42972 69564
4 12016 168978 41692 158254
3 279062 126207 256111
2 126207 136045
5 174375 177539 126207 42224 108173
3 179728 ...

output:

58579.879066666667
28819.767020000000
35264.433670000000
77080.626463333333
17808.890596666667
96414.067723333333
37060.142976666667
96414.067723333333
83156.014590000000
72858.734836666667
43618.121190000000
96414.067723333333
96414.067723333333
38736.125526666667
96414.067723333333
96414.067723333...

result:

ok 300000 numbers

Test #25:

score: 0
Accepted
time: 195ms
memory: 13856kb

input:

300000 3000
347 56478 204263 76691 265446 5360 26423 95256 195667 128406 99722 177562 175055 13210 154674 88284 196227 60392 297562 80078 179333 151004 233521 176873 58903 254739 217826 241387 109580 86763 87709 165063 202919 268171 58778 128645 234210 84032 205871 63012 110167 168788 118032 121390 ...

output:

148317.355333333333
13229.217000000000
108759.972333333333
9715.099000000000
14771.155000000000
75143.276333333333
44080.582666666667
85297.107666666667
63029.586666666667
67443.303000000000
54224.660666666667
45270.301333333333
148317.355333333333
148317.355333333333
72133.227000000000
31808.541000...

result:

ok 300000 numbers

Test #26:

score: 0
Accepted
time: 88ms
memory: 9564kb

input:

30000 300000
0
3 414 5579 23513
4 414 8287 6392 871
5 414 7696 6206 19336 4268
1 6627
7 3188 3181 24176 6334 414 21394 19595
0
3 1786 2224 414
6 6861 7122 22569 21220 4045 5579
0
2 414 5947
3 414 17193 18305
5 16314 11465 5579 414 18305
4 6002 20737 1569 27293
5 408 414 7938 18233 1322
5 14363 27059...

output:

24793.911350000000
6864.235846666667
5759.611426666667
22432.709213333333
15787.448103333333
25401.899066666667
15486.531523333333
15634.764166666667
24455.579300000000
4523.002736666667
14050.316806666667
17965.217676666667
16722.729150000000
12996.669573333333
17667.560596666667
19163.978976666667...

result:

ok 30000 numbers

Test #27:

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

input:

1000 1000
1000 44 839 681 251 965 449 430 775 369 534 990 905 75 234 969 457 318 250 330 342 704 911 109 711 712 6 18 816 998 592 632 886 144 289 296 981 799 379 726 154 536 934 427 269 602 523 541 994 315 611 660 841 495 242 70 399 855 988 949 676 820 264 12 41 585 960 552 876 116 647 238 694 801 9...

output:

1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
...

result:

ok 1000 numbers

Test #28:

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

input:

1000 1000
102 468 438 833 811 970 821 318 789 478 762 17 656 877 672 874 35 86 850 491 614 107 421 71 537 773 297 728 751 357 398 490 713 50 896 802 469 816 13 772 483 14 553 199 26 905 48 101 252 298 361 760 284 637 371 295 385 384 364 142 100 649 520 955 720 640 389 380 464 463 148 15 476 106 511 ...

output:

173.178000000000
201.268000000000
121.217000000000
673.098000000000
677.493000000000
682.782000000000
666.521000000000
57.253000000000
952.227000000000
276.997000000000
524.141000000000
603.032000000000
1.000000000000
886.143000000000
545.247000000000
680.265000000000
59.541000000000
668.73200000000...

result:

ok 1000 numbers

Test #29:

score: 0
Accepted
time: 187ms
memory: 15840kb

input:

300000 10
100163 199441 107576 272955 159138 175728 278205 153152 35458 167071 137298 53 156083 161962 187743 921 292697 137977 203118 140281 143487 212439 11839 118131 264455 43059 49523 107694 77229 1464 80054 287475 255817 173531 187163 13087 275101 215163 209999 169678 188485 85798 297949 270357...

output:

8465.700000000000
145502.800000000000
145150.600000000000
120904.600000000000
63821.600000000000
39405.100000000000
46820.700000000000
56518.600000000000
18538.300000000000
115369.900000000000
34413.600000000000
219717.100000000000
88880.900000000000
53602.300000000000
163398.100000000000
161492.600...

result:

ok 300000 numbers

Test #30:

score: 0
Accepted
time: 208ms
memory: 14516kb

input:

300000 300000
3 8653 56239 219542
5 95662 37358 105119 150584 77480
6 4048 258603 75954 263320 95295 37358
3 140501 171436 76539
5 15612 257530 199498 157762 182596
3 265333 255908 182573
4 166010 291455 256151 192163
6 83616 1577 37358 263781 40744 247124
3 238092 37358 273714
3 240019 28215 120700...

output:

88430.606000000000
98502.169886666667
63674.929080000000
44218.019746666667
98502.169886666667
98502.169886666667
23481.337363333333
98502.169886666667
53398.402866666667
45661.891146666667
98502.169886666667
58976.103676666667
4529.535833333333
84590.602683333333
98502.169886666667
84169.8109433333...

result:

ok 300000 numbers

Test #31:

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

input:

15000 300000
4 11232 643 2833 3527
2 13308 3480
4 5510 9655 46 11069
3 11956 3527 2052
2 8610 11234
2 7629 5293
5 6492 3480 7688 2774 14036
3 3480 10795 11630
4 4557 14572 2052 3756
0
1 1763
5 10520 4172 5178 9538 6379
0
1 10183
2 13021 5293
2 3527 1804
2 9115 12418
3 14914 11308 5688
3 2052 13021 1...

output:

5254.070273333333
10143.099260000000
10252.979483333333
6061.436503333333
329.414110000000
1316.224986666667
2758.616256666667
8302.325793333333
3575.099283333333
9264.088246666667
6691.774210000000
8132.190643333333
5909.681300000000
7355.370863333333
11301.998453333333
3219.137566666667
1825.54917...

result:

ok 15000 numbers

Test #32:

score: 0
Accepted
time: 215ms
memory: 13776kb

input:

300000 300000
2 208568 111922
4 91432 77323 125218 198677
3 94774 1393 119875
5 207083 61681 183716 51268 151727
1 250066
1 197792
2 259534 214913
6 172941 137989 157017 62295 272066 208917
2 163103 136199
3 119936 172317 7851
3 20633 21474 204622
1 205687
3 214744 84964 125285
3 46467 63138 881
4 1...

output:

43063.417153333333
162835.603920000000
160498.453763333333
140417.761383333333
99187.945133333333
96812.467583333333
88942.588800000000
30493.775393333333
169560.440153333333
76390.176196666667
65174.780923333333
180265.830420000000
156978.397370000000
172347.312483333333
56928.567176666667
101454.2...

result:

ok 300000 numbers

Test #33:

score: 0
Accepted
time: 69ms
memory: 7928kb

input:

600 300000
6 141 100 306 519 87 277
5 181 401 88 217 19
5 561 54 91 85 279
2 17 74
4 562 472 30 506
6 464 88 228 492 142 445
1 167
2 228 87
3 174 236 385
8 590 417 148 183 427 110 573 194
4 308 424 429 167
3 369 72 382
2 578 457
2 403 73
1 171
4 443 306 583 146
3 540 442 583
2 541 46
5 54 322 432 10...

output:

357.305113333333
442.496653333333
178.002296666667
243.743830000000
344.765396666667
412.083026666667
112.424663333333
594.056020000000
358.401830000000
201.664980000000
550.569553333333
460.977226666667
160.188300000000
84.669120000000
3.902623333333
196.733293333333
93.021870000000
5.568060000000
...

result:

ok 600 numbers

Test #34:

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

input:

300000 300000
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

output:

1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
1.000000000000
...

result:

ok 300000 numbers

Test #35:

score: 0
Accepted
time: 176ms
memory: 13888kb

input:

300000 300000
150000 152378 20536 230896 243531 130262 222665 146584 12680 200961 255680 2766 29860 293060 200643 182208 86955 290788 137148 79258 187602 223959 170916 247928 46417 10375 136965 171609 213627 82670 98292 163902 213617 207226 53553 128847 234468 29348 152905 210512 265156 144800 22868...

output:

1.500000000000
100000.000000000000
99999.500000000000
99999.500000000000
2.000000000000
1.500000000000
1.000000000000
1.500000000000
2.000000000000
100000.000000000000
99999.500000000000
100000.000000000000
100000.000000000000
100000.000000000000
100000.000000000000
99999.500000000000
99999.50000000...

result:

ok 300000 numbers

Test #36:

score: 0
Accepted
time: 69ms
memory: 7980kb

input:

3000 300000
1500 1243 2819 1259 2982 2440 368 2897 2784 102 1448 137 96 2361 2465 1233 28 150 9 2924 1872 2732 2744 185 239 587 2016 1383 1517 2006 2722 2725 2275 1122 971 859 2533 2918 1488 742 869 227 258 2925 2083 901 2089 2959 2264 1213 782 2442 330 2038 1434 2846 1024 1870 2476 402 2679 1149 17...

output:

1.800000000000
1.840000000000
999.635000000000
999.690000000000
999.555000000000
999.530000000000
999.530000000000
999.575000000000
999.665000000000
1.820000000000
999.675000000000
999.595000000000
999.670000000000
1.810000000000
1.790000000000
999.560000000000
999.625000000000
1.760000000000
999.67...

result:

ok 3000 numbers