QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#187448#3003. Cost of LivingSolitaryDream#AC ✓35ms5688kbC++201.8kb2023-09-24 17:22:342023-09-24 17:22:34

Judging History

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

  • [2023-09-24 17:22:34]
  • 评测
  • 测评结果:AC
  • 用时:35ms
  • 内存:5688kb
  • [2023-09-24 17:22:34]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define FOR(i,s,t) for(int i=(s),_t=(t); i<=_t; ++i)
#define DOR(i,s,t) for(int i=(s),_t=(t); i>=_t; --i)
typedef long long ll;
typedef double db;
const db eps=1e-8;
int sgn(db x) {
    return x<-eps?-1:x>eps;
}
const int M=1115;
const int N=222;
db a[M][N];
int pos[N];
db b[N];
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(9);
    int n,c,qr;
    cin >> n >> c >> qr;
    int m=0;
    FOR(i,1,n-1) {
        db v;
        cin >> v;
        if(v<-0.5) continue;
        ++m;
        a[m][c*2+i]=1;
        a[m][c*2+n]=log(v);
    }
    FOR(i,1,n) {
        FOR(j,1,c) {
            db v;
            cin >> v;
            if(v<-0.5) continue;
            ++m;
            a[m][j]=1;
            a[m][c+j]=i-1;
            FOR(k,1,i-1) {
                a[m][c*2+k]=1;
            }
            a[m][c*2+n]=log(v);
        }
    }
    int l=c*2+n;
    int K=0;
    FOR(i,1,m) {
        int &p=pos[i];
        p=pos[i-1]+1;
        int q;
        while(p<l) {
            q=0;
            FOR(j,i,m) if(sgn(a[j][p])) if(!q || a[j][p]>a[q][p]) q=j;
            if(q) break;
            p++;
        }
        if(p==l) break;
        FOR(j,p,l) swap(a[i][j],a[q][j]);
        FOR(j,i+1,m) DOR(k,l,p) a[j][k]-=a[i][k]*a[j][p]/a[i][p];
        K=i;
    }
    while(qr--) {
        int x,y;
        cin >> x >> y;
        FOR(i,1,l) b[i]=0;

        b[x]=1;
        b[c+x]=y-1;
        FOR(k,1,y-1) b[c*2+k]=1;

        FOR(i,1,K) DOR(j,l,pos[i]) b[j]-=a[i][j]*b[pos[i]]/a[i][pos[i]];
        int w=1;
        FOR(i,1,l-1) if(sgn(b[i])) {w=0;break;}
        db res=exp(-b[l]);
        if(w==0) res=-1;
        cout << res << '\n';
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 35ms
memory: 5688kb

input:

10 100 1000
1.4232425477
1.4587468547
1.4988380864
1.4232605904
1.4616348675
1.4896779426
1.4308848629
1.4737913284
1.4757245744
6.5778960564 1.5393071490 4.3707126564 3.6695325734 2.3650352685 2.8394679709 1.3411604400 9.3106822560 6.3826766975 9.5128884762 7.6533007241 3.9582086668 3.5031379898 6....

output:

6.577896056
1.539307149
4.370712656
3.669532573
2.365035268
2.839467971
1.341160440
9.310682256
6.382676697
9.512888476
7.653300724
3.958208667
3.503137990
6.792418644
7.844444941
5.687855736
9.798107540
6.832417826
3.596095940
1.213239991
8.622413610
3.981432453
3.180240854
5.853805769
9.159688519
...

result:

ok 1000 numbers

Test #2:

score: 0
Accepted
time: 16ms
memory: 4588kb

input:

10 100 700
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000 -1.0000000000 999984.9915250402 999927.5728325787 999990.6803247513 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 999909.1348272597 -1.0000...

output:

34695.646809998
114941.462746304
16078.298991227
517203.349369043
842775.936181610
88002.315940944
177756.717709542
538943.105651589
825613.810366336
291565.173554446
195902.270342787
999917.418448884
572409.566251773
62638.722149084
999924.319007678
407778.466414425
999978.261905911
4747.239524585
...

result:

ok 700 numbers

Test #3:

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

input:

4 4 1
-1
-1
-1
5.00 -1 5.00 -1
-1 -1 -1 -1
10.00 -1 10.00 -1
-1 -1 11.00 -1
1 4

output:

11.000000000

result:

ok found '11.00000', expected '11.00000', error '0.00000'

Test #4:

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

input:

4 4 8
1.1526548258
1.3314092554
1.0836964938
-1.0000000000 -1.0000000000 -1.0000000000 3.0796000590
4.0215499785 7.3420629650 4.0491125763 3.9906580185
7.3946475528 -1.0000000000 -1.0000000000 -1.0000000000
-1.0000000000 41.6296254448 6.7385283248 -1.0000000000
3 3
1 1
1 4
3 1
4 4
2 1
4 3
2 3

output:

5.789811260
2.526281607
11.067195578
3.270902473
7.277221476
3.213188858
5.973199280
19.378147431

result:

ok 8 numbers

Test #5:

score: 0
Accepted
time: 15ms
memory: 4552kb

input:

10 100 800
1.0521634367
1.1729602789
1.1306073452
1.2084144349
1.0078862583
1.1225242003
1.0771205309
1.1964754687
1.3075271282
-1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 2.6116023550 3.8020605784 -1.0000000000 1.1923112759 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000...

output:

7.347385924
3.659139030
23.575855771
17.267002851
6.325205995
1283.601122407
2075.050350616
4.517915722
809.562881311
610.068079494
3.596031869
7.397114621
26.052252005
14.539056038
131.671703296
301.158144689
5.884608447
361.054079825
316.141388262
49.927980979
28.998938198
3.759265873
25.308925782...

result:

ok 800 numbers

Test #6:

score: 0
Accepted
time: 15ms
memory: 4472kb

input:

10 100 800
1.2899791474
1.3915779601
1.3485588348
1.1594621188
1.0920622916
1.1565222542
1.0587715090
1.2046496522
1.1064292921
-1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 1.0510368784 3.2247427692 -1.000...

output:

2.763964035
5.732629747
6.132169770
28.643377875
18.473458183
900.108432757
21237.076247559
5.690306964
6253.046250629
4.495827138
16.833356998
151.298984977
24.694087792
528.713666376
304.835920458
25.147695734
54.161555376
89.962974965
1473.231686174
527.239330995
548.635794271
4323.075368841
4692...

result:

ok 800 numbers

Test #7:

score: 0
Accepted
time: 15ms
memory: 4456kb

input:

10 100 800
1.2335580178
1.1412549423
1.2636981872
1.0526410525
1.4674476261
1.0958246554
1.0466222670
1.2130025095
1.4887983698
-1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 4.1485663392 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 1.227...

output:

29176.038114228
482.307206690
5183.698300198
15.819093672
10.498903217
100.304011404
176.955475094
1715.538624279
8.394842213
1278.860043154
1888.476950252
21639.761542382
16.349252442
7.437058614
226.805806889
1.552289406
386.097999522
121.403535708
18.245953193
4288.053896189
186.334538231
24.8283...

result:

ok 800 numbers

Test #8:

score: 0
Accepted
time: 15ms
memory: 4432kb

input:

10 100 800
1.3175894920
1.2377319458
1.4641933114
1.3503200115
1.1285925026
1.4815063735
1.0789026817
1.1885103209
1.3966339158
1.1869655041 -1.0000000000 4.6015195578 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.000...

output:

560.000436046
336.441148095
7556.970185049
7.052701438
784.049328376
3113.512141777
5552.217179307
8.985411320
62.190322014
12084.372500284
1.429997513
13337.582972958
36.505421494
21618.983951374
69.573885429
2.462772118
3.302612811
7174.320753189
67.768432380
1413.103927551
21.026838741
68.9727239...

result:

ok 800 numbers

Test #9:

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

input:

10 100 800
1.0229245005
1.2237172315
1.3135991079
1.3393777895
1.2020081719
1.4538382518
1.4322652821
1.4068822581
1.0466032669
-1.0000000000 -1.0000000000 3.5573212846 2.4303986142 4.8018918640 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 2.2404459367 -1.00000...

output:

6.718347332
117.152848534
1537.297432978
19.245495049
516.459333287
45.662693872
28.640456601
601.451602422
5.069128512
3.191619255
8.914295023
1238.635395831
727.806093559
63.011363660
19380.626251872
7.618663268
17304.616215787
4.675732164
4577.355374986
21.258013913
2.028738985
124.705485950
2539...

result:

ok 800 numbers

Test #10:

score: 0
Accepted
time: 16ms
memory: 4456kb

input:

10 100 800
1.2776330738
1.3262397787
1.0936173086
1.2506250361
1.2400873318
1.1721111311
1.2246621786
1.3638339615
1.1735227970
2.3274523768 -1.0000000000 -1.0000000000 -1.0000000000 3.1624258566 -1.0000000000 4.8259576984 -1.0000000000 2.0694932933 -1.0000000000 -1.0000000000 -1.0000000000 -1.00000...

output:

14.867239935
159.006867032
172.220385000
4.414282984
2167.677029044
14.490535167
8537.904475420
28170.341525084
12.146151399
6.568042202
3.619820464
2023.137147496
23.455618036
23.566969727
988.714245899
23.446378837
4.291196783
1.179848434
556.271443736
17936.629003987
418.590703363
324.751526712
1...

result:

ok 800 numbers

Test #11:

score: 0
Accepted
time: 15ms
memory: 4488kb

input:

10 100 800
1.2713921167
1.3589950021
1.4646596382
1.0268993278
1.3347254135
1.1409169610
1.4976473069
1.1611135028
1.3759583622
-1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 4.3875847073 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.00...

output:

13.408019716
139.178751730
19113.069207764
4.203830770
13395.282610836
1061.959563557
2.108550486
3788.720261465
17.008522151
40.436280855
91.218366317
2356.513471495
1.008909106
5.595823750
2.430444527
9.919784333
3145.712878500
992.930275742
3.512832311
4.636122777
10128.874662753
11.686104525
6.2...

result:

ok 800 numbers

Test #12:

score: 0
Accepted
time: 15ms
memory: 4440kb

input:

10 100 800
1.0501988692
1.0457193911
1.2072818261
1.1134012252
1.1453399136
1.2696923791
1.3947999503
1.1505678861
1.0705078222
-1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 4.9872342708 -1.0000000000 -1.0000000000 -1.0000000000 3.2735632693 -1.000...

output:

5.493315569
36.417805429
8.989102330
13.288421892
825.510328951
2478.084026050
10.203012692
14.842085381
335.274340416
4662.974406427
11145.193090610
1.333877765
2.732427178
31.033339916
8714.201586738
35.326422397
844.468031100
61.678045984
1020.433165350
2.370469010
13.098702809
118.132836017
1539...

result:

ok 800 numbers

Test #13:

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

input:

10 100 800
1.1379620977
1.4484034825
1.0543961923
1.4376887816
1.4408356074
1.4038140736
1.2288980916
1.0276153023
1.1431729363
2.3050825918 -1.0000000000 -1.0000000000 -1.0000000000 1.6669517279 4.5758080971 -1.0000000000 -1.0000000000 1.0842605202 -1.0000000000 4.1978620846 -1.0000000000 -1.000000...

output:

903.554853366
388.862136077
10884.090014511
245.878552379
240.302104945
24.105645445
45.344691247
531.984960616
61.201892791
14221.629137052
5.916952606
11567.638751018
22155.246656178
331.407388883
2.784371613
69.117772143
172.600323255
5286.616023265
6.594350238
39.527455144
40.833509336
9.1832135...

result:

ok 800 numbers

Test #14:

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

input:

6 4 24
-1
-1
1
1
1
-1 2 -1 -1
-1 -1 -1 -1
2 -1 -1 -1
-1 2 -1 -1
-1 2 -1 -1
2 -1 -1 -1
1 1
2 1
3 1
4 1
1 2
2 2
3 2
4 2
1 3
2 3
3 3
4 3
1 4
2 4
3 4
4 4
1 5
2 5
3 5
4 5
1 6
2 6
3 6
4 6

output:

2.000000000
2.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
2.000000000
2.000000000
-1.000000000
-1.000000000
2.000000000
2.000000000
-1.000000000
-1.000000000
2.000000000
2.000000000
-1.000000000
-1.000000000
2.000000000
2.000000000
-1.000000000
-1.000000000

result:

ok 24 numbers

Test #15:

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

input:

10 4 40
-1
-1
-1
-1
-1
1
1
1
-1
-1 -1 -1 -1
2 2 -1 2
-1 -1 -1 -1
2 2 -1 -1
-1 -1 -1 -1
2 -1 -1 -1
-1 2 -1 -1
-1 -1 -1 -1
-1 -1 -1 2
-1 -1 -1 -1
1 1
2 1
3 1
4 1
1 2
2 2
3 2
4 2
1 3
2 3
3 3
4 3
1 4
2 4
3 4
4 4
1 5
2 5
3 5
4 5
1 6
2 6
3 6
4 6
1 7
2 7
3 7
4 7
1 8
2 8
3 8
4 8
1 9
2 9
3 9
4 9
1 10
2 10
3 ...

output:

-1.000000000
-1.000000000
-1.000000000
-1.000000000
2.000000000
2.000000000
-1.000000000
2.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
2.000000000
2.000000000
-1.000000000
2.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
2.000000000
2.000000000
-1.000000000
2.0000000...

result:

ok 40 numbers

Test #16:

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

input:

6 4 24
-1
-1
-1
-1
-1
-1 2 2 -1
-1 2 -1 -1
-1 -1 -1 2
2 2 -1 -1
2 -1 2 -1
2 -1 2 -1
1 1
2 1
3 1
4 1
1 2
2 2
3 2
4 2
1 3
2 3
3 3
4 3
1 4
2 4
3 4
4 4
1 5
2 5
3 5
4 5
1 6
2 6
3 6
4 6

output:

2.000000000
2.000000000
2.000000000
-1.000000000
2.000000000
2.000000000
2.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
2.000000000
2.000000000
2.000000000
2.000000000
-1.000000000
2.000000000
2.000000000
2.000000000
-1.000000000
2.000000000
2.000000000
2.000000000
-1.000000000

result:

ok 24 numbers

Test #17:

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

input:

6 2 12
-1
-1
-1
-1
-1
2 -1
2 -1
2 -1
-1 2
-1 2
-1 2
1 1
2 1
1 2
2 2
1 3
2 3
1 4
2 4
1 5
2 5
1 6
2 6

output:

2.000000000
-1.000000000
2.000000000
-1.000000000
2.000000000
-1.000000000
-1.000000000
2.000000000
-1.000000000
2.000000000
-1.000000000
2.000000000

result:

ok 12 numbers

Test #18:

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

input:

10 1 10
-1
-1
-1
-1
1
1
1
1
1
-1
-1
-1
-1
-1
-1
-1
128
256
-1
1 1
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10

output:

-1.000000000
-1.000000000
-1.000000000
-1.000000000
16.000000000
32.000000000
64.000000000
128.000000000
256.000000000
512.000000000

result:

ok 10 numbers

Test #19:

score: 0
Accepted
time: 16ms
memory: 4600kb

input:

10 100 700
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 999981.3062264143 999903.4478394005 9...

output:

999929.992496791
999903.447839400
999987.321651900
999929.992496789
999933.171287340
999992.483530536
999927.194927113
999936.906737546
999995.032184158
999962.777600771
999908.181406694
999946.881181229
999937.809386528
999933.408712736
999916.190744836
999907.797721720
999935.367203730
999925.6062...

result:

ok 700 numbers

Test #20:

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

input:

4 4 4
-1.0000000000
-1.0000000000
-1.0000000000
1.8928429526 -1.0000000000 -1.0000000000 -1.0000000000
2.8237713441 8.5031341337 5.1105589373 8.0067820072
-1.0000000000 14.0582533008 5.4057455625 10.7656273636
4.1557987046 26.1121938963 6.4239546067 16.2622392308
3 1
1 3
4 1
2 1

output:

3.706797950
3.231931766
4.568718271
3.945884857

result:

ok 4 numbers

Test #21:

score: 0
Accepted
time: 16ms
memory: 4652kb

input:

10 100 700
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 4.4468276012 3.3094085810 -1.0000000000 -1.0000000000 1.9115931026 -1.0000000000 -1.000000000...

output:

10.876177497
452.628446952
249.784973470
18.250633821
54.252212192
5.730373074
10.669133864
394.278262471
14.145792439
2.814894825
1470.233619690
4.512038397
8.662265766
650.558554638
108.063441584
196.525907741
42.069440068
18.914453651
38777.694105284
66.644369806
2.795964920
3.188545345
3.8915535...

result:

ok 700 numbers

Test #22:

score: 0
Accepted
time: 16ms
memory: 4648kb

input:

10 100 700
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000 -1.0000000000 -1.0000000000 1.7599370304 -1.0000000000 3.8881524183 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.00000000...

output:

52.077267428
135.281312408
254.863869177
591.607522155
7.633295439
1.198541772
109.827131477
26.476860303
239.813247656
4.426682193
16669.783877794
301.730541633
19.512900225
8999.626089203
8826.374305636
161.591503149
2.074247973
166.860816000
19.986980576
109.484734055
19090.223692899
47.177321985...

result:

ok 700 numbers

Test #23:

score: 0
Accepted
time: 13ms
memory: 4724kb

input:

10 100 700
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 1.0901945854 -1.0000000000 -1.0000000000 3.6862311053 -1.0000000000 3.0471500872 -1.000000000...

output:

42.326350542
222.101046228
5.474256172
14.900664037
7.568585343
260.510217101
6.679141546
2334.453751240
234.945506643
8.657001395
5.810891645
64.726797243
18.436216396
7.126540209
4.486432091
6631.819763918
1405.858977263
9.684494837
10.384982362
3052.088434469
12.340636260
83.374473329
9031.149195...

result:

ok 700 numbers

Test #24:

score: 0
Accepted
time: 16ms
memory: 4584kb

input:

10 100 700
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 2.2548748007 4.7362238853 -1.0000000000 2.1204692893 2.4533130632 1.3569169662 1.7167450103 -1.0000000000 -...

output:

30.696255470
5.258452531
7.900550987
453.649554448
13.842810376
36.202929000
9.225751326
1019.787043512
9.981083603
95477.873340708
14.475259615
11.682587306
1757.097576448
501.456562414
438.574783185
36024.267477124
155.263515895
3498.608584692
1779.665760339
292.984616343
6.385440999
1394.88428070...

result:

ok 700 numbers

Test #25:

score: 0
Accepted
time: 16ms
memory: 4584kb

input:

10 100 700
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000 4.8362270584 -1.0000000000 -1.0000000000 4.6038264788 -1.0000000000 -1.0000000000 2.8720165885 -1.0000000000 4.7525733203 1.0014144503 -1.0000000000 ...

output:

18.918955474
4509.579996684
1.410448842
2476.019788275
7.914519567
4450.883333134
10.597518592
20.615388397
21.816384327
3492.582820226
56.836120449
537.959914720
473.620249682
875.214515357
4567.264144102
4237.002799072
14523.763685171
53.827801479
3252.926156632
53.048016973
3.651720100
17935.2613...

result:

ok 700 numbers

Test #26:

score: 0
Accepted
time: 16ms
memory: 4556kb

input:

10 100 700
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 1.1808166722 -1.0000000000 -1.0000000000 -1.0000000000 2.1799998719 -1.0000000000 -1.0000000000 3.474584851...

output:

4.346760118
12.130652739
6.879745678
15.562867896
55.795061874
253.104404906
6.592032894
2.466569651
68.893396790
2.554591432
114.878543116
243.402350787
3.635215200
2240.382881985
248.921744197
10.258590138
1.719170378
4715.696481879
4422.652448034
17.061869409
501.570940571
1.334271531
9.267364172...

result:

ok 700 numbers

Test #27:

score: 0
Accepted
time: 16ms
memory: 4624kb

input:

10 100 700
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
4.3649542456 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 4.5636989486 -1.0000000000 3.8017048357 -1.0000000000 -1.0000000000 -1.0000000000 2.5748655606...

output:

1390.818823732
565.433613881
301.479858200
20.317041479
25.146120492
112.809541275
3.741191899
11.837369703
1049.958970435
1682.479469611
30.310643988
79.621112282
724.463963207
85.467547135
1.804052787
12.826391286
8.708770705
66.725141120
526.020487336
8.255413616
92.173130694
11.562107107
37335.8...

result:

ok 700 numbers

Test #28:

score: 0
Accepted
time: 16ms
memory: 4456kb

input:

10 100 700
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000 -1.0000000000 1.6710908486 -1.0000000000 1.1629480169 4.2383499853 -1.0000000000 4.2214426199 2.3762098507 -1.0000000000 1.4540884083 -1.0000000000 -...

output:

802.186678007
94.482472867
11.228888075
7.975448133
255.411936659
44.740125864
62.372206166
96.090372530
34.947647539
672.297035868
2917.219186329
18.768379845
3.017174566
383.741550555
4.942077637
124.505445310
11.688747021
13.401148099
5.967338914
99.154184572
155.389382211
1.489795391
7029.799022...

result:

ok 700 numbers

Test #29:

score: 0
Accepted
time: 16ms
memory: 4624kb

input:

10 100 700
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000 -1.0000000000 2.0719063417 -1.0000000000 -1.0000000000 -1.0000000000 4.1270212263 3.8181242083 4.7440500035 -1.0000000000 -1.0000000000 -1.0000000000...

output:

6.409314817
906.099686699
6138.683515059
2.739385938
13.080703239
5.600328570
271.146478077
25.062152310
51.323511856
1.802829463
1623.859729758
7.879574176
7.883537554
61.993781228
153.955123416
17.425669461
19.558866059
4.405949237
1661.529597808
21.695003443
206.089909950
132.550317997
36.3520966...

result:

ok 700 numbers

Test #30:

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

input:

10 100 1000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.00000...

output:

-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-...

result:

ok 1000 numbers

Test #31:

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

input:

10 100 300
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000 2.9677417732 5.5481975929 1.2388237272 2.7895388562 6.8489599400 5.9044733254 -1.0000000000 -1.0000000000 8.2848741101 -1.0000000000 8.2523732665 7.2...

output:

215.665236681
3.728421924
6.768656187
740.758790357
24.445690354
52115.528004845
4079.001418734
343.925442327
13469.093922996
19217.571938051
189.161896644
39.631831407
4.594604546
762.214843854
5.083513357
34.722695582
70936.787015155
162.084175142
183.031120746
593.997347979
71.111505096
21221.802...

result:

ok 300 numbers

Test #32:

score: 0
Accepted
time: 17ms
memory: 5112kb

input:

10 100 400
-1.0000000000
1.4274480380
-1.0000000000
-1.0000000000
1.4744668841
-1.0000000000
-1.0000000000
-1.0000000000
1.4904155291
3.5757473631 8.1897410756 -1.0000000000 -1.0000000000 -1.0000000000 6.5880204682 -1.0000000000 -1.0000000000 6.9326338629 8.5450340527 -1.0000000000 -1.0000000000 6.8...

output:

51112.565158278
2459.008594755
185.786097776
151196.335417686
25.787234216
406.542940215
214.918939135
9064.194879627
121.502796882
47.164272353
440.478591821
11.292859848
45.118007412
-1.000000000
6.052666440
17.289751798
24.924689445
272.732929401
6.570970993
13.508620735
49.579310290
69.681792115...

result:

ok 400 numbers

Test #33:

score: 0
Accepted
time: 18ms
memory: 5004kb

input:

10 100 500
-1.0000000000
1.4134092751
1.4242858516
1.4203336733
1.4646705852
-1.0000000000
1.4847133386
1.4092463997
-1.0000000000
-1.0000000000 3.4161542907 7.0630472857 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 7.5187471587 -1.0000000000 5.3145478582 8.8252646637 3.9966787974 -1.0000...

output:

-1.000000000
-1.000000000
-1.000000000
38.931002733
8.500264438
10.223903948
513.457437295
7.449156577
270.917689514
6317.852052451
129.042582000
67459.857474560
783.287532429
-1.000000000
-1.000000000
15644.103848991
1091.107599156
-1.000000000
123.067543882
132.199371104
911.409398181
108.07190264...

result:

ok 500 numbers

Test #34:

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

input:

10 100 600
-1.0000000000
1.4222706523
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000 -1.0000000000 -1.0000000000 6.8803570282 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 6.4378294846 -1.0000000000 3.7413816229...

output:

2071.751438318
-1.000000000
20.941601056
-1.000000000
45460.597265604
-1.000000000
2730.304422115
51241.583947206
31.157281865
-1.000000000
13554.795609586
33627.464016497
16.758772331
-1.000000000
1.818059922
1550.414876017
-1.000000000
51.457520622
56.148340329
-1.000000000
-1.000000000
-1.0000000...

result:

ok 600 numbers

Test #35:

score: 0
Accepted
time: 13ms
memory: 4568kb

input:

10 100 700
1.4807840691
1.4261252588
1.4700774873
1.4484918514
-1.0000000000
1.4862014428
1.4342847995
1.4084401466
1.4145070252
9.4054766923 2.3873526867 5.4635344801 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 6.7381719985 -1.0000000000 -1.0000000000 4.1056814752 -1.0000000000 -1.00000...

output:

41.747571117
1036.865545479
1049.010701641
-1.000000000
-1.000000000
27316.416807709
7893.093456483
18.848835814
18.758550380
-1.000000000
-1.000000000
3.993892632
330.879831563
-1.000000000
87.340899552
-1.000000000
-1.000000000
-1.000000000
35979.761886716
-1.000000000
853.740282008
-1.000000000
-...

result:

ok 700 numbers

Test #36:

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

input:

4 4 5
1.3389137753
1.2453132838
1.4745777478
-1.0000000000 1.6279270129 4.4597430791 3.3655243133
-1.0000000000 4.1559002643 -1.0000000000 6.1753680584
14.3054065549 9.8678221715 28.9725311378 10.5389895251
-1.0000000000 27.7438397589 84.3289704033 -1.0000000000
4 4
1 2
3 2
1 4
1 1

output:

21.297280638
-1.000000000
11.786507415
-1.000000000
-1.000000000

result:

ok 5 numbers

Test #37:

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

input:

10 100 799
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
1.0417332012
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 1.6769048894 -1.00000000...

output:

44.753759517
-1.000000000
1.691151538
-1.000000000
-1.000000000
76.057108053
-1.000000000
-1.000000000
63.777527112
-1.000000000
53.162041655
-1.000000000
-1.000000000
41.203034581
-1.000000000
-1.000000000
-1.000000000
207.687668341
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-...

result:

ok 799 numbers

Test #38:

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

input:

10 100 800
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000 -1.0000000000 -1.0000000000 3.3116776323 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 4.0812629475 -1.0000000000 -1.00000000...

output:

10.430159733
40.509037873
-1.000000000
-1.000000000
-1.000000000
895.524243478
620.915994975
-1.000000000
374.057414570
-1.000000000
-1.000000000
-1.000000000
4.182594612
-1.000000000
-1.000000000
-1.000000000
106.686583043
107.079207253
-1.000000000
819.492645155
11.718116578
-1.000000000
-1.000000...

result:

ok 800 numbers

Test #39:

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

input:

10 100 792
1.4655502165
1.1366001379
1.1035631980
1.0307136632
1.4432255049
1.2609673825
-1.0000000000
1.4254184302
1.2967916824
4.8401049699 1.2258643958 2.8268315927 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 2.9593860382 -1.0000000000 1.7786958166 3.9621935042 -1.000000...

output:

-1.000000000
11.132559370
3470.296438261
2.982885300
-1.000000000
-1.000000000
5427.956074674
-1.000000000
-1.000000000
12.117953721
-1.000000000
50.533198295
106.824070080
3.480029929
2.250914266
29.664120574
-1.000000000
987.376552927
-1.000000000
227.111812357
-1.000000000
-1.000000000
-1.0000000...

result:

ok 792 numbers

Test #40:

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

input:

10 100 800
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
3.3758827143 -1.0000000000 -1.0000000000 -1.0000000000 2.4657513310 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 2.9504286374 2.9641394449...

output:

-1.000000000
-1.000000000
92.693122399
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
23900.317508077
9.280147487
1635.195037740
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
148.230242183
7991.220067016
-1.000000000
-1.000000000
-1.0000...

result:

ok 800 numbers

Test #41:

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

input:

10 100 793
-1.0000000000
-1.0000000000
1.1058495647
1.4171439424
1.3733467703
1.0547271715
1.2084647978
1.1683697215
1.3287618448
3.4619418449 -1.0000000000 -1.0000000000 3.7680268404 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 3.6895113450 -1.0000000000 -1.0000000000 -1.0000000000 2.229...

output:

-1.000000000
299.937433753
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
16.921202154
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
...

result:

ok 793 numbers

Test #42:

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

input:

10 100 796
1.0531446023
-1.0000000000
1.0186246091
1.0350047232
-1.0000000000
1.1037101466
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000 -1.0000000000 2.4434727517 -1.0000000000 -1.0000000000 3.1434137308 -1.0000000000 3.9004131477 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 3....

output:

-1.000000000
-1.000000000
11.854217486
2.431194711
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
1.929582597
2.961486771
20.405696313
-1.000000000
10.095627302
-1.000000000
3.922898012
1882.550185276
406.914537819
3.712001049
-1....

result:

ok 796 numbers

Test #43:

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

input:

10 100 799
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
1.3139944530
-1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 3.5705709729 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.00000000...

output:

13.052538305
-1.000000000
1147.067604728
123.111234802
2.179142021
1165.964236330
-1.000000000
-1.000000000
484.644931786
121.388365130
-1.000000000
-1.000000000
8.733871329
-1.000000000
8.171816786
-1.000000000
482.180544835
788.003583576
-1.000000000
-1.000000000
71.019653476
36.158713619
4.175819...

result:

ok 799 numbers

Test #44:

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

input:

10 100 798
1.1380052780
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
1.1568359591
-1.0000000000
4.0757491018 -1.0000000000 -1.0000000000 1.4319198930 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 2.8003678023 3.1546478531 3...

output:

116.989482931
-1.000000000
-1.000000000
1570.883779253
-1.000000000
11.306834879
22.663584195
-1.000000000
-1.000000000
8.413109862
-1.000000000
104.170441628
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
28075.97982...

result:

ok 798 numbers

Test #45:

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

input:

10 100 791
1.1787459246
1.3922470978
1.1151446200
1.1925113501
1.3939072649
1.4397895392
1.1010497913
1.3784205494
1.4928830754
-1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 3.1841543266 -1.0000000000 3.0738497347 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.000...

output:

-1.000000000
-1.000000000
6.339588707
67.835191375
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.000000000
11385.524112694
-1.000000000
770.625771861
-1.000000000
-1.000000000
-1.000000000
32.933604096
-1.000000000
-1.000000000
-1.000000000
-1.000000000
18.943106860
-1.000000000
7.442775392...

result:

ok 791 numbers

Test #46:

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

input:

10 100 799
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
1.4432609112
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000 -1.0000000000 8.2785518545 3.4829212847 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 8.7727208263...

output:

-1.000000000
-1.000000000
20.018951086
-1.000000000
-1.000000000
-1.000000000
158.111318023
-1.000000000
-1.000000000
-1.000000000
-1.000000000
17302.807554323
5259.716870832
266.131250862
-1.000000000
660.876776414
12420.081763612
6.349042174
-1.000000000
-1.000000000
-1.000000000
-1.000000000
-1.0...

result:

ok 799 numbers

Test #47:

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

input:

10 100 799
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
1.4945916321
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 -1.0000000000 4.2176774528 -1.00000000...

output:

-1.000000000
117.050276440
1458.101750221
-1.000000000
-1.000000000
-1.000000000
16.757543833
-1.000000000
-1.000000000
-1.000000000
58.011025060
-1.000000000
437.358146355
6.543808345
92.076767316
-1.000000000
2594.231420969
-1.000000000
-1.000000000
-1.000000000
10.908088083
-1.000000000
-1.000000...

result:

ok 799 numbers

Test #48:

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

input:

10 100 800
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000
-1.0000000000 4.8583709046 -1.0000000000 7.7675870926 -1.0000000000 -1.0000000000 -1.0000000000 6.0676531577 -1.0000000000 -1.0000000000 -1.0000000000 -1.000000000...

output:

123.722435464
13.525344392
-1.000000000
149.616382600
30.876629333
-1.000000000
2244.397689124
-1.000000000
38.288420199
-1.000000000
-1.000000000
16078.656396138
-1.000000000
-1.000000000
-1.000000000
-1.000000000
10.491375847
196.323854065
16.729739486
8136.168082167
1.821900673
445.414824035
-1.0...

result:

ok 800 numbers