QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#189024#2721. Card Scoringlgswdn25 ✓1419ms126812kbC++142.2kb2023-09-26 19:21:132023-09-26 19:21:15

Judging History

This is the latest submission verdict.

  • [2023-09-26 19:21:15]
  • Judged
  • Verdict: 25
  • Time: 1419ms
  • Memory: 126812kb
  • [2023-09-26 19:21:13]
  • Submitted

answer

#include<bits/stdc++.h>
#define fi first
#define se second
#define eb emplace_back
#define mp make_pair
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef __int128 i128; 
template<typename T,typename U>
T ceil(T x, U y) {return (x>0?(x+y-1)/y:x/y);}
template<typename T,typename U>
T floor(T x, U y) {return (x>0?x/y:(x-y+1)/y);}
template<class T,class S>
bool chmax(T &a,const S b) {return (a<b?a=b,1:0);}
template<class T,class S>
bool chmin(T &a,const S b) {return (a>b?a=b,1:0);}
int popcnt(int x) {return __builtin_popcount(x);}
int popcnt(ll x)  {return __builtin_popcountll(x);}
int topbit(int x) {return (x==0?-1:31-__builtin_clz(x));}
int topbit(ll x)  {return (x==0?-1:63-__builtin_clzll(x));}
int lowbit(int x) {return (x==0?-1:__builtin_ctz(x));}
int lowbit(ll x)  {return (x==0?-1:__builtin_ctzll(x));}

#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
typedef pair<int,int> pii; 
typedef vector<int> vi;
typedef vector<pii> vp;
typedef tuple<int,int,int> tiii;
int read() {
  int x=0,w=1; char c=getchar(); 
  while(!isdigit(c)) {if(c=='-') w=-1; c=getchar();}
  while(isdigit(c)) {x=x*10+(c-'0'); c=getchar();}
  return x*w;
}

const int N=1e6+5;
int n,k,a[N],c[N],b[N],t[N];
double f[N];
vp q[N];
vi p[N];

double val(int j,int i) {return pow(b[i]-b[j]+1,k/2.)+f[j-1];}
 
signed main() {
  k=read(), n=read();
  rep(i,1,n) p[i].eb(0), t[i]=-1;
  rep(i,1,n) a[i]=read(), p[a[i]].eb(i);
  rep(i,1,n) c[a[i]]++, b[i]=c[a[i]];
  if(k==2) return printf("%d\n",n), 0;
  rep(i,1,n) {
    int x=a[i]; f[i]=f[i-1]+1;
    while(t[x]>=0&&q[x][t[x]].se<i) t[x]--, q[x].pop_back();
    if(t[x]>=0) chmax(f[i],val(q[x][t[x]].fi,i));
    while(t[x]>=0) {
      int pos=b[i];
      for(int l=b[i]+1,r=c[x];l<=r;) {
        int mid=l+r>>1;
        double vt=val(q[x][t[x]].fi,p[x][mid]), vi=val(i,p[x][mid]);
        if(vt<vi) l=mid+1, pos=p[x][mid]; else r=mid-1;
      }
      if(pos>=q[x][t[x]].se) t[x]--, q[x].pop_back();
      else {t[x]++, q[x].eb(i,pos); break;}
    } if(t[x]==-1) t[x]++, q[x].eb(i,n);
  }
  printf("%.7lf\n",f[n]);
  return 0;
}

詳細信息

Subtask #1:

score: 4
Accepted

Test #1:

score: 4
Accepted
time: 4ms
memory: 50884kb

input:

3 10
2
1
2
2
2
2
1
1
2
2

output:

18.5202592

result:

ok found '18.5202592', expected '18.5202592', error '0.0000000'

Test #2:

score: 0
Accepted
time: 11ms
memory: 50880kb

input:

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

output:

23.2207320

result:

ok found '23.2207320', expected '23.2207320', error '0.0000000'

Test #3:

score: 0
Accepted
time: 11ms
memory: 50804kb

input:

4 10
2
1
2
2
2
2
1
1
2
2

output:

49.0000000

result:

ok found '49.0000000', expected '49.0000000', error '0.0000000'

Test #4:

score: 0
Accepted
time: 9ms
memory: 50860kb

input:

4 20
4
7
18
16
14
16
7
13
10
2
3
8
11
20
4
7
1
7
13
17

output:

22.0000000

result:

ok found '22.0000000', expected '22.0000000', error '0.0000000'

Subtask #2:

score: 1
Accepted

Test #5:

score: 1
Accepted
time: 4ms
memory: 50484kb

input:

2 300
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

300

result:

ok found '300.0000000', expected '300.0000000', error '0.0000000'

Test #6:

score: 0
Accepted
time: 12ms
memory: 50612kb

input:

2 300
284
287
178
116
294
236
287
193
250
122
63
128
291
260
264
227
241
127
173
137
12
69
268
130
183
231
63
224
68
236
30
103
223
259
270
268
194
257
212
143
130
274
22
120
285
38
99
225
216
271
114
227
92
81
57
274
63
171
197
182
106
226
285
28
237
6
47
130
14
258
25
196
283
46
15
268
135
165
244...

output:

300

result:

ok found '300.0000000', expected '300.0000000', error '0.0000000'

Test #7:

score: 0
Accepted
time: 9ms
memory: 50544kb

input:

2 10
2
1
2
2
2
2
1
1
2
2

output:

10

result:

ok found '10.0000000', expected '10.0000000', error '0.0000000'

Test #8:

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

input:

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

output:

100

result:

ok found '100.0000000', expected '100.0000000', error '0.0000000'

Subtask #3:

score: 5
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Test #9:

score: 5
Accepted
time: 4ms
memory: 50724kb

input:

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

output:

327.3879311

result:

ok found '327.3879311', expected '327.3879311', error '0.0000000'

Test #10:

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

input:

4 300
84
87
78
16
94
36
87
93
50
22
63
28
91
60
64
27
41
27
73
37
12
69
68
30
83
31
63
24
68
36
30
3
23
59
70
68
94
57
12
43
30
74
22
20
85
38
99
25
16
71
14
27
92
81
57
74
63
71
97
82
6
26
85
28
37
6
47
30
14
58
25
96
83
46
15
68
35
65
44
51
88
9
77
79
89
85
4
52
55
100
33
61
77
69
40
13
27
87
95
4...

output:

304.0000000

result:

ok found '304.0000000', expected '304.0000000', error '0.0000000'

Test #11:

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

input:

4 10
2
1
2
2
2
2
1
1
2
2

output:

49.0000000

result:

ok found '49.0000000', expected '49.0000000', error '0.0000000'

Test #12:

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

input:

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

output:

102.4852814

result:

ok found '102.4852814', expected '102.4852814', error '0.0000000'

Subtask #4:

score: 3
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Test #13:

score: 3
Accepted
time: 12ms
memory: 51116kb

input:

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

output:

8994.6209482

result:

ok found '8994.6209482', expected '8994.6209480', error '0.0000000'

Test #14:

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

input:

4 5000
84
87
78
16
94
36
87
93
50
22
63
28
91
60
64
27
41
27
73
37
12
69
68
30
83
31
63
24
68
36
30
3
23
59
70
68
94
57
12
43
30
74
22
20
85
38
99
25
16
71
14
27
92
81
57
74
63
71
97
82
6
26
85
28
37
6
47
30
14
58
25
96
83
46
15
68
35
65
44
51
88
9
77
79
89
85
4
52
55
100
33
61
77
69
40
13
27
87
95
...

output:

5167.0000000

result:

ok found '5167.0000000', expected '5167.0000000', error '0.0000000'

Test #15:

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

input:

4 4000
2
1
2
2
2
2
1
1
2
2
1
2
1
2
2
1
1
1
1
1
2
1
2
2
1
1
1
2
2
2
2
1
1
1
2
2
2
1
2
1
2
2
2
2
1
2
1
1
2
1
2
1
2
1
1
2
1
1
1
2
2
2
1
2
1
2
1
2
2
2
1
2
1
2
1
2
1
1
2
1
2
1
1
1
1
1
2
2
1
2
1
1
1
1
2
1
1
1
1
2
2
1
1
1
2
2
2
1
2
1
1
1
2
1
1
2
2
2
1
2
1
2
2
2
2
2
2
2
2
2
2
1
2
2
1
2
1
2
2
1
1
2
1
2
2
2
1...

output:

4137161.0000000

result:

ok found '4137161.0000000', expected '4137161.0000000', error '0.0000000'

Test #16:

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

input:

3 5000
384
887
778
916
794
336
387
493
650
422
363
28
691
60
764
927
541
427
173
737
212
369
568
430
783
531
863
124
68
136
930
803
23
59
70
168
394
457
12
43
230
374
422
920
785
538
199
325
316
371
414
527
92
981
957
874
863
171
997
282
306
926
85
328
337
506
847
730
314
858
125
896
583
546
815
368...

output:

5008.2842712

result:

ok found '5008.2842712', expected '5008.2842710', error '0.0000000'

Subtask #5:

score: 3
Accepted

Test #17:

score: 3
Accepted
time: 1074ms
memory: 104888kb

input:

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

output:

10088193700.0000000

result:

ok found '10088193700.0000000', expected '10088193700.0000000', error '0.0000000'

Test #18:

score: 0
Accepted
time: 1191ms
memory: 106888kb

input:

4 1000000
84
87
78
16
94
36
87
93
50
22
63
28
91
60
64
27
41
27
73
37
12
69
68
30
83
31
63
24
68
36
30
3
23
59
70
68
94
57
12
43
30
74
22
20
85
38
99
25
16
71
14
27
92
81
57
74
63
71
97
82
6
26
85
28
37
6
47
30
14
58
25
96
83
46
15
68
35
65
44
51
88
9
77
79
89
85
4
52
55
100
33
61
77
69
40
13
27
87
...

output:

105781372.0000000

result:

ok found '105781372.0000000', expected '105781372.0000000', error '0.0000000'

Test #19:

score: 0
Accepted
time: 402ms
memory: 77756kb

input:

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

output:

62677125317.0000000

result:

ok found '62677125317.0000000', expected '62677125320.0000000', error '0.0000000'

Test #20:

score: 0
Accepted
time: 418ms
memory: 80484kb

input:

4 500000
384
887
778
916
794
336
387
493
650
422
363
28
691
60
764
927
541
427
173
737
212
369
568
430
783
531
863
124
68
136
930
803
23
59
70
168
394
457
12
43
230
374
422
920
785
538
199
325
316
371
414
527
92
981
957
874
863
171
997
282
306
926
85
328
337
506
847
730
314
858
125
896
583
546
815
3...

output:

501462.0000000

result:

ok found '501462.0000000', expected '501462.0000000', error '0.0000000'

Test #21:

score: 0
Accepted
time: 477ms
memory: 106392kb

input:

4 1000000
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51...

output:

10100000000.0000000

result:

ok found '10100000000.0000000', expected '10100000000.0000000', error '0.0000000'

Test #22:

score: 0
Accepted
time: 373ms
memory: 105600kb

input:

4 1000000
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
50...

output:

1001000000.0000000

result:

ok found '1001000000.0000000', expected '1001000000.0000000', error '0.0000000'

Test #23:

score: 0
Accepted
time: 586ms
memory: 105000kb

input:

4 1000000
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
...

output:

110000000000.0000000

result:

ok found '110000000000.0000000', expected '110000000000.0000000', error '0.0000000'

Test #24:

score: 0
Accepted
time: 1205ms
memory: 107028kb

input:

4 1000000
384
887
778
916
794
336
387
493
650
422
363
28
691
60
764
927
541
427
173
737
212
369
568
430
783
531
863
124
68
136
930
803
23
59
70
168
394
457
12
43
230
374
422
920
785
538
199
325
316
371
414
527
92
981
957
874
863
171
997
282
306
926
85
328
337
506
847
730
314
858
125
896
583
546
815
...

output:

1203548.0000000

result:

ok found '1203548.0000000', expected '1203548.0000000', error '0.0000000'

Test #25:

score: 0
Accepted
time: 1232ms
memory: 109296kb

input:

4 1000000
884
287
478
116
294
836
587
193
250
722
663
428
591
260
564
527
241
127
773
137
612
369
268
430
783
531
63
824
668
236
330
703
523
859
870
868
794
557
212
143
430
874
622
120
285
338
699
525
516
571
714
227
92
81
657
874
663
771
797
482
106
226
285
628
237
306
647
130
14
858
325
496
883
46...

output:

1507071.0000000

result:

ok found '1507071.0000000', expected '1507071.0000000', error '0.0000000'

Test #26:

score: 0
Accepted
time: 1191ms
memory: 107620kb

input:

4 1000000
86
5
724
776
723
74
158
850
499
452
528
629
609
593
567
491
634
163
395
836
270
414
160
556
444
237
972
770
632
524
216
85
529
307
228
619
380
386
836
878
205
376
874
813
336
809
672
969
339
79
186
608
848
345
177
304
936
516
86
935
52
301
33
580
963
615
566
355
368
414
601
928
157
487
753...

output:

1218622.0000000

result:

ok found '1218622.0000000', expected '1218622.0000000', error '0.0000000'

Subtask #6:

score: 9
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Test #27:

score: 9
Accepted
time: 499ms
memory: 126812kb

input:

3 1000000
289384
930887
692778
636916
747794
238336
885387
760493
516650
641422
202363
490028
368691
520060
897764
513927
180541
383427
89173
455737
5212
595369
702568
956430
465783
21531
722863
665124
174068
703136
513930
979803
634023
723059
133070
898168
961394
18457
175012
478043
176230
377374
4...

output:

1000000.8284271

result:

ok found '1000000.8284271', expected '1000000.8280000', error '0.0000000'

Test #28:

score: 0
Accepted
time: 1206ms
memory: 104884kb

input:

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

output:

31831783.1935372

result:

ok found '31831783.1935372', expected '31831783.1900000', error '0.0000000'

Test #29:

score: 0
Accepted
time: 1419ms
memory: 106728kb

input:

3 1000000
84
87
78
16
94
36
87
93
50
22
63
28
91
60
64
27
41
27
73
37
12
69
68
30
83
31
63
24
68
36
30
3
23
59
70
68
94
57
12
43
30
74
22
20
85
38
99
25
16
71
14
27
92
81
57
74
63
71
97
82
6
26
85
28
37
6
47
30
14
58
25
96
83
46
15
68
35
65
44
51
88
9
77
79
89
85
4
52
55
100
33
61
77
69
40
13
27
87
...

output:

1043197.9906030

result:

ok found '1043197.9906030', expected '1043197.9910000', error '0.0000000'

Test #30:

score: 0
Accepted
time: 388ms
memory: 77676kb

input:

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

output:

125265594.9648308

result:

ok found '125265594.9648308', expected '125265595.0000000', error '0.0000000'

Test #31:

score: 0
Accepted
time: 330ms
memory: 78908kb

input:

3 500000
384
887
778
916
794
336
387
493
650
422
363
28
691
60
764
927
541
427
173
737
212
369
568
430
783
531
863
124
68
136
930
803
23
59
70
168
394
457
12
43
230
374
422
920
785
538
199
325
316
371
414
527
92
981
957
874
863
171
997
282
306
926
85
328
337
506
847
730
314
858
125
896
583
546
815
3...

output:

500397.2088976

result:

ok found '500397.2088976', expected '500397.2089000', error '0.0000000'

Test #32:

score: 0
Accepted
time: 317ms
memory: 122592kb

input:

3 1000000
11
999999
11
999997
11
999995
11
999993
11
999991
11
999989
11
999987
11
999985
11
999983
11
999981
11
999979
11
999977
11
999975
11
999973
11
999971
11
999969
11
999967
11
999965
11
999963
11
999961
11
999959
11
999957
11
999955
11
999953
11
999951
11
999949
11
999947
11
999945
11
999943
...

output:

79056961.5042095

result:

ok found '79056961.5042095', expected '79056961.5042095', error '0.0000000'

Test #33:

score: 0
Accepted
time: 318ms
memory: 122540kb

input:

4 1000000
11
999999
11
999997
11
999995
11
999993
11
999991
11
999989
11
999987
11
999985
11
999983
11
999981
11
999979
11
999977
11
999975
11
999973
11
999971
11
999969
11
999967
11
999965
11
999963
11
999961
11
999959
11
999957
11
999955
11
999953
11
999951
11
999949
11
999947
11
999945
11
999943
...

output:

13125000018.0000000

result:

ok found '13125000018.0000000', expected '13125000018.0000000', error '0.0000000'

Test #34:

score: 0
Accepted
time: 588ms
memory: 122412kb

input:

4 1000000
401
135
402
208
403
311
404
69
405
233
406
241
407
305
408
18
409
144
410
229
411
56
412
187
413
374
414
181
415
180
416
77
417
166
418
235
419
111
420
367
421
284
422
22
423
14
424
323
425
23
426
122
427
62
428
129
429
76
430
188
431
154
432
275
433
9
434
126
435
75
436
306
437
268
438
11...

output:

1813128.0000000

result:

ok found '1813128.0000000', expected '1813128.0000000', error '0.0000000'

Test #35:

score: 0
Accepted
time: 607ms
memory: 122324kb

input:

4 1000000
401
110
402
196
403
158
404
166
405
108
406
37
407
294
408
291
409
398
410
141
411
166
412
237
413
360
414
288
415
262
416
138
417
10
418
147
419
213
420
49
421
156
422
388
423
200
424
53
425
251
426
269
427
236
428
392
429
271
430
21
431
194
432
182
433
326
434
354
435
224
436
196
437
96
...

output:

1900013.0000000

result:

ok found '1900013.0000000', expected '1900013.0000000', error '0.0000000'

Test #36:

score: 0
Accepted
time: 600ms
memory: 122324kb

input:

4 1000000
401
336
402
329
403
204
404
133
405
134
406
206
407
328
408
255
409
6
410
351
411
10
412
222
413
53
414
300
415
342
416
172
417
61
418
282
419
199
420
70
421
199
422
215
423
385
424
20
425
363
426
295
427
38
428
285
429
335
430
246
431
378
432
247
433
65
434
330
435
144
436
193
437
330
438...

output:

1832229.0000000

result:

ok found '1832229.0000000', expected '1832229.0000000', error '0.0000000'

Test #37:

score: 0
Accepted
time: 452ms
memory: 122336kb

input:

3 1000000
401
375
402
1
403
128
404
176
405
75
406
75
407
174
408
171
409
131
410
300
411
165
412
43
413
164
414
371
415
109
416
84
417
237
418
316
419
60
420
198
421
278
422
231
423
110
424
354
425
281
426
163
427
345
428
287
429
33
430
309
431
178
432
223
433
394
434
117
435
30
436
256
437
182
438...

output:

1000000.1961524

result:

ok found '1000000.1961524', expected '1000000.1960000', error '0.0000000'

Test #38:

score: 0
Accepted
time: 609ms
memory: 122360kb

input:

4 1000000
401
356
402
264
403
365
404
386
405
27
406
333
407
1
408
210
409
315
410
168
411
312
412
59
413
375
414
29
415
269
416
178
417
318
418
380
419
335
420
183
421
114
422
33
423
211
424
285
425
257
426
117
427
303
428
99
429
51
430
41
431
230
432
82
433
35
434
243
435
287
436
328
437
219
438
7...

output:

1831573.0000000

result:

ok found '1831573.0000000', expected '1831573.0000000', error '0.0000000'

Test #39:

score: 0
Accepted
time: 618ms
memory: 122292kb

input:

4 1000000
401
371
402
116
403
3
404
184
405
306
406
269
407
202
408
302
409
90
410
26
411
274
412
10
413
106
414
273
415
240
416
174
417
315
418
224
419
235
420
41
421
161
422
298
423
318
424
38
425
377
426
87
427
387
428
304
429
354
430
41
431
17
432
187
433
317
434
394
435
57
436
118
437
366
438
3...

output:

1826198.0000000

result:

ok found '1826198.0000000', expected '1826198.0000000', error '0.0000000'

Test #40:

score: 0
Accepted
time: 354ms
memory: 105720kb

input:

3 1000000
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
501
50...

output:

31622776.6016834

result:

ok found '31622776.6016834', expected '31622776.6000000', error '0.0000000'

Test #41:

score: 0
Accepted
time: 477ms
memory: 106496kb

input:

3 1000000
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51
51...

output:

100000000.0000000

result:

ok found '100000000.0000000', expected '100000000.0000000', error '0.0000000'

Test #42:

score: 0
Accepted
time: 573ms
memory: 104900kb

input:

3 1000000
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
...

output:

316227766.0168379

result:

ok found '316227766.0168379', expected '316227766.0000000', error '0.0000000'

Test #43:

score: 0
Accepted
time: 1367ms
memory: 106804kb

input:

3 1000000
84
87
78
16
94
36
87
93
50
22
63
28
91
60
64
27
41
27
73
37
12
69
68
30
83
31
63
24
68
36
30
3
23
59
70
68
94
57
12
43
30
74
22
20
85
38
99
25
16
71
14
27
92
81
57
74
63
71
97
82
6
26
85
28
37
6
47
30
14
58
25
96
83
46
15
68
35
65
44
51
88
9
77
79
89
85
4
52
55
100
33
61
77
69
40
13
27
87
...

output:

1043197.9906030

result:

ok found '1043197.9906030', expected '1043197.9910000', error '0.0000000'

Test #44:

score: 0
Accepted
time: 1175ms
memory: 106192kb

input:

3 1000000
134
137
28
116
144
86
137
43
100
122
63
128
141
110
114
77
91
127
23
137
12
69
118
130
33
81
63
74
68
86
30
103
73
109
120
118
44
107
62
143
130
124
22
120
135
38
99
75
66
121
114
77
92
81
57
124
63
21
47
32
106
76
135
28
87
6
47
130
14
108
25
46
133
46
15
118
135
15
94
51
38
109
127
129
3...

output:

1005687.6621030

result:

ok found '1005687.6621030', expected '1005687.6620000', error '0.0000000'

Test #45:

score: 0
Accepted
time: 1304ms
memory: 107512kb

input:

3 1000000
104
47
58
116
114
56
107
13
10
62
3
68
51
20
84
47
61
67
53
17
12
9
88
70
63
51
63
44
68
56
90
43
103
19
30
88
74
17
92
83
70
94
22
120
105
98
39
45
36
91
54
47
92
21
117
34
63
51
77
2
106
46
45
88
57
66
47
10
74
18
85
16
103
106
15
88
75
45
4
111
8
49
37
99
69
25
4
12
75
80
13
61
117
49
2...

output:

1007032.6024862

result:

ok found '1007032.6024862', expected '1007032.6020000', error '0.0000000'

Extra Test:

score: 0
Extra Test Passed