QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#297729#7903. Computational IntelligencestdAC ✓713ms3796kbC++6.3kb2024-01-05 04:15:522024-01-05 04:15:53

Judging History

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

  • [2024-01-05 04:15:53]
  • 评测
  • 测评结果:AC
  • 用时:713ms
  • 内存:3796kb
  • [2024-01-05 04:15:52]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;

typedef long double db;

const db pi=acos(db(-1));

const db eps0=1e-18;
int sgn0(db x)
{
    if(x>eps0)return 1;
    if(x<-eps0)return -1;
    return 0;
}

const db eps1=1e-12;
int sgn1(db x)
{
    if(x>eps1)return 1;
    if(x<-eps1)return -1;
    return 0;
}

struct Point
{
    db x,y;
    Point() {}
    Point(db _x,db _y):x(_x),y(_y) {}
    Point operator + (const Point& t)const
    {
        return Point(x+t.x,y+t.y);
    }
    Point operator - (const Point& t)const
    {
        return Point(x-t.x,y-t.y);
    }
    Point operator * (const db& t)const
    {
        return Point(x*t,y*t);
    }
    Point operator / (const db& t)const
    {
        return Point(x/t,y/t);
    }
    db operator ^ (const Point& t)const
    {
        return x*t.x+y*t.y;
    }
    db len()const
    {
        return sqrt(x*x+y*y);
    }
    db ang()const
    {
        return atan2(y,x);
    }
};

struct Integrate
{
    db chx[2],shx[2],cx[2],sx[2],lgr[2];
    Integrate(db l,db r)
    {
        db t[2]= {l,r};
        for(int i=0; i<2; i++)
        {
            chx[i]=cos(t[i]/2);
            shx[i]=sin(t[i]/2);
            cx[i]=cos(t[i]);
            sx[i]=sin(t[i]);
            lgr[i]=log(abs((chx[i]+shx[i])/(chx[i]-shx[i])));
        }
    }
    db int_1(int s)const // \int_l^r (sinx)^s/(cosx)^(s-1) dx
    {
        if(s==0)return sx[1]-sx[0];
        if(s==1)return -cx[1]+cx[0];
        if(s==2)return (-sx[1]+lgr[1])-(-sx[0]+lgr[0]);
        if(s==3)return (cx[1]+1/cx[1])-(cx[0]+1/cx[0]);
        return NAN;
    }
    db int_1(int n,db *p)const // \int_l^r \prod_{i=1}^{n} cos(x-a_i) / (cosx)^{n-1} dx
    {
        db res=0;
        for(int i=0; i<=n; i++)
            if(sgn0(p[i]))res+=p[i]*int_1(n-i);
        return res;
    }
};

struct Integrate2
{
    db ca,sa,tta[3],tra[3],rra[3];
    Integrate intgr_0,intgr_a;
    Integrate2(db a,db l,db r):intgr_0(l,r),intgr_a(l-a,r-a)
    {
        ca=cos(a),sa=sin(a);
        db ta[2]={-sa,ca},ra[2]={ca,sa};
        for(int i=0;i<3;i++)
            tta[i]=tra[i]=rra[i]=0;
        for(int i=0;i<2;i++)
            for(int j=0;j<2;j++)
            {
                tta[i+j]+=ta[i]*ta[j];
                tra[i+j]+=ta[i]*ra[j];
                rra[i+j]+=ra[i]*ra[j];
            }
    }
    db int_2(int s) // \int_l^r (sinx)^s/((cosx)^(s-2)*cos(x-a)) dx
    {
        if(s==0)return intgr_a.int_1(2,tta);
        if(s==1)return intgr_a.int_1(2,tra);
        if(s==2)return intgr_a.int_1(2,rra);
        if(s==3)
        {
            db res=intgr_0.int_1(2);
            if(sgn0(ca))res-=ca*intgr_a.int_1(2,rra);
            return res/sa;
        }
        return NAN;
    }
    db int_2(int n,db *p) // \int_l^r \prod_{i=1}^{n} cos(x-a_i) / ((cosx)^{n-2}*cos(x-a)) dx
    {
        if(!sgn0(sa))return intgr_0.int_1(n,p)/ca;
        db res=0;
        for(int i=0; i<=n; i++)
            if(sgn0(p[i]))res+=p[i]*int_2(n-i);
        return res;
    }
};

db cal_disjoint(Point s[4],db l,db r)
{
    Point mid=(s[0]+s[1])/2-(s[2]+s[3])/2;
    db res=mid.x*(sin(r)-sin(l))+mid.y*(-cos(r)+cos(l));
    return abs(res);
}

db cal_contain(Point s[4],db l,db r)
{
    swap(s[0],s[2]),swap(s[1],s[3]);
    Point mid=(s[0]+s[1])/2-(s[2]+s[3])/2;
    db all=mid.x*(sin(r)-sin(l))+mid.y*(-cos(r)+cos(l));
    db ang0=(s[3]-s[2]).ang();
    l-=ang0,r-=ang0;
    db ang1=(s[0]-s[2]).ang()-ang0;
    db ang2=(s[1]-s[2]).ang()-ang0;
    db angx=(s[1]-s[0]).ang()-ang0;
    // db angy=(s[2]-s[3]).ang()-ang0; // pi
    // db angc=(s[0]-s[2]).ang()-ang0; // ang1
    db cof1=(s[0]-s[2]).len()/(s[3]-s[2]).len();
    db cof2=(s[1]-s[2]).len()/(s[3]-s[2]).len();
    db a1[2]={sin(ang1),cos(ang1)},a2[2]={sin(ang2),cos(ang2)},ax[2]={sin(angx),cos(angx)};
    db a1x[3]={},a2x[3]={},a11[3]={},a12[3]={},a22[3]={};
    for(int i=0;i<2;i++)
        for(int j=0;j<2;j++)
        {
            a1x[i+j]+=a1[i]*ax[j];
            a2x[i+j]+=a2[i]*ax[j];
            a11[i+j]+=a1[i]*a1[j];
            a12[i+j]+=a1[i]*a2[j];
            a22[i+j]+=a2[i]*a2[j];
        }
    Integrate intgr(l,r);
    db res=(intgr.int_1(2,a1x)*cof1+intgr.int_1(2,a2x)*cof2*2)/6*(s[1]-s[0]).len();
    res-=(intgr.int_1(2,a11)*cof1*cof1+intgr.int_1(2,a12)*cof1*cof2+intgr.int_1(2,a22)*cof2*cof2)/6*(s[2]-s[3]).len();
    res+=(intgr.int_1(2,a11)*cof1+intgr.int_1(2,a12)*cof2)/2*(s[0]-s[2]).len();
    return abs(all-2*res);
}

db cal_intersect(Point s[4],db l,db r)
{
    swap(s[0],s[1]);
    Point mid=(s[0]+s[1])/2-(s[2]+s[3])/2;
    db all=mid.x*(sin(r)-sin(l))+mid.y*(-cos(r)+cos(l));
    db ang1=(s[1]-s[0]).ang();
    l-=ang1,r-=ang1;
    db ang0=(s[2]-s[0]).ang()-ang1;
    db ang2=(s[2]-s[3]).ang()-ang1;
    // db angx=(s[1]-s[0]).ang()-ang1; // 0
    // db angy=(s[2]-s[3]).ang()-ang1; // ang2
    // db angc=(s[0]-s[2]).ang()-ang1; // ang0+pi
    db cof1=(s[2]-s[0]).len()/(s[1]-s[0]).len();
    db cof2=(s[2]-s[0]).len()/(s[2]-s[3]).len();
    db cof=cof1*cof1*cof2/6*(s[1]-s[0]).len()+cof1*cof2*cof2/6*(s[2]-s[3]).len()-cof1*cof2/2*(s[0]-s[2]).len();
    db a0[2]={sin(ang0),cos(ang0)},at0[4]={};
    for(int i=0;i<2;i++)
        for(int j=0;j<2;j++)
            for(int k=0;k<2;k++)
                at0[i+j+k]+=a0[i]*a0[j]*a0[k];
    db res=cof*Integrate2(ang2,l,r).int_2(3,at0);
    return abs(all-2*res);
}

db cal(Point s[4],db l,db r)
{
    db m=(l+r)/2;
    Point d=Point(cos(m),sin(m));
    db l1=s[0]^d,r1=s[1]^d,l2=s[2]^d,r2=s[3]^d;
    if(l1>r1)swap(l1,r1),swap(s[0],s[1]);
    if(l2>r2)swap(l2,r2),swap(s[2],s[3]);
    if(l1>l2 || (l1==l2 && r1<r2))
        swap(l1,l2),swap(r1,r2),swap(s[0],s[2]),swap(s[1],s[3]);
    if(sgn1(r1-l2)<=0)return cal_disjoint(s,l,r);
    if(sgn1(r1-r2)>=0)return cal_contain(s,l,r);
    return cal_intersect(s,l,r);
}

int solve()
{
    Point s[4];
    for(int i=0; i<4; i++)
    {
        int x,y;
        scanf("%d%d",&x,&y);
        s[i]=Point(x,y);
    }
    vector<db> cut{0,pi};
    for(int i=0; i<4; i++)
        for(int j=i+1; j<4; j++)
        {
            if(!sgn1((s[i]-s[j]).len()))continue;
            db t=(s[i]-s[j]).ang()+pi/2;
            while(t<0)t+=pi;
            while(t>=pi)t-=pi;
            cut.push_back(t);
        }
    sort(cut.begin(),cut.end());
    cut.erase(unique(cut.begin(),cut.end()),cut.end());
    db res=0;
    for(size_t i=0; i+1<cut.size(); i++)
        res+=cal(s,cut[i],cut[i+1]);
    return 0*printf("%.18Lf\n",res/2);
}

int main()
{
    int T;
    scanf("%d",&T);
    while(T--)solve();
    return 0;
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3732kb

input:

3
0 0 1 0
0 0 1 0
0 0 1 0
0 0 0 1
0 0 1 0
0 1 1 1

output:

0.333333333333333333
0.765195716464212691
1.076635732895178009

result:

ok 3 numbers

Test #2:

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

input:

3
0 1 0 0
0 -1 0 2
0 0 1 0
2 0 -1 0
-1000 0 0 999
0 -998 999 0

output:

0.777777777777777778
0.777777777777777778
1521.070405024625244561

result:

ok 3 numbers

Test #3:

score: 0
Accepted
time: 537ms
memory: 3688kb

input:

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

output:

9.028267617368163209
5.744131448896088735
14.594278702891625945
2.952178245414318406
4.993502694096405177
6.058717255359191638
7.459408700248973382
11.228028907920078652
16.325707847495085561
11.072245157189769066
9.504557451156429247
5.500000000000000000
9.040049985828503264
5.326347910887315090
3....

result:

ok 100000 numbers

Test #4:

score: 0
Accepted
time: 348ms
memory: 3680kb

input:

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

output:

6.516226342415054756
7.895152181058052672
7.619252804123872738
6.272101354085806654
10.676587784335646463
4.048146349220735429
13.704168816473701996
5.960724885233347412
4.752273723764898792
5.808486858315500547
6.049334617405312978
4.212001303539058819
5.231052190722964012
7.816888558906682757
4.83...

result:

ok 100000 numbers

Test #5:

score: 0
Accepted
time: 231ms
memory: 3696kb

input:

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

output:

4.533823502911814448
7.905694150420948331
3.399346342395189887
0.942809041582063366
8.062257748298549652
9.848857801796104722
6.500000000000000000
6.699917080747260179
4.533823502911814448
5.830951894845300471
6.016087653749434183
5.467073155618908389
5.676462121975467056
3.800584750330459930
5.5176...

result:

ok 100000 numbers

Test #6:

score: 0
Accepted
time: 228ms
memory: 3680kb

input:

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

output:

6.523809523809523810
4.013864859597431827
7.500000000000000000
5.507010122909450445
2.748737083745107033
2.687419249432849885
3.901566636906541703
2.108185106778919554
4.333333333333333333
2.357022603955158415
4.176654695380555930
5.059644256269406931
3.484848484848484848
3.144660377352201271
4.0276...

result:

ok 100000 numbers

Test #7:

score: 0
Accepted
time: 536ms
memory: 3688kb

input:

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

output:

6.044841559802776669
8.806908441628239269
7.211988492479204399
9.705894454247985566
5.879889741427976195
11.751734336572820885
7.387327468407571281
7.552508251824662238
4.795900553740575117
4.585511109955949942
11.636587321970351163
6.539467273582366623
8.155918942815778049
6.932750625884107778
3.74...

result:

ok 100000 numbers

Test #8:

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

input:

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

output:

6.797092276544249500
12.429172495064871571
8.976426143537842489
7.486123031629840830
7.130299838204027490
6.028769291755010000
4.087930934616961610
4.823038522430569278
6.123128729377019586
7.246635688903556032
7.724226961177313366
10.316193728709801410
5.124308856570905652
4.791595303087936915
3.30...

result:

ok 100000 numbers

Test #9:

score: 0
Accepted
time: 249ms
memory: 3796kb

input:

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

output:

5.011098792790969424
6.749485577105528978
4.346134936801765810
4.333333333333333333
5.270462766947298887
3.282952600598701574
3.726779962499649494
2.687419249432849884
1.943650631615100157
5.099019513592784830
2.108185106778919555
5.217491947499509292
5.587684871413403376
6.839428176227730354
1.6996...

result:

ok 100000 numbers

Test #10:

score: 0
Accepted
time: 568ms
memory: 3692kb

input:

100000
50 -71 4 90
-69 -29 12 -1
-98 -38 -10 34
-40 -94 48 19
-2 36 -25 -55
-56 38 -22 -84
-80 -18 28 63
1 -14 74 -19
73 59 76 -61
-52 -28 -97 -91
-9 -54 89 33
-65 93 -64 12
-65 -77 79 87
-95 -40 49 -61
-88 -97 47 83
59 65 -30 -35
-55 59 89 -91
27 98 -17 93
-49 84 74 -90
37 4 -59 -18
72 -27 63 -34
9...

output:

77.596705004720335712
83.979645362580432708
49.327207070989801407
83.974820099517698567
163.879147592890255250
128.662991662277805677
86.719766610911257917
72.434035081352803734
120.317190035193321840
65.378944996367682654
38.467358046172843419
142.394344968572782381
172.484435283356014393
88.797397...

result:

ok 100000 numbers

Test #11:

score: 0
Accepted
time: 375ms
memory: 3728kb

input:

100000
74 50 60 -48
-17 -68 74 50
57 80 36 23
-1 -98 57 80
94 -87 4 1
4 1 44 -70
8 90 -93 -87
-93 -87 10 -51
56 -56 43 -16
56 -56 49 20
56 -21 85 24
56 -21 -45 24
46 -83 67 -90
46 -83 -96 -54
7 -59 -81 95
52 -63 -81 95
-96 -74 -6 92
-6 92 -100 72
91 33 -9 55
-9 55 -27 5
30 36 58 -40
88 -31 30 36
49 ...

output:

58.366697243089087774
69.863330974219166623
43.490764400868867808
87.084290278394169568
26.087927019376965929
68.005214731179379234
83.472363923872791552
69.433387650753950138
86.012446755888855007
63.715166111727914919
33.878784640337858334
62.029070851020141036
66.298085751655952774
34.85202327764...

result:

ok 100000 numbers

Test #12:

score: 0
Accepted
time: 264ms
memory: 3672kb

input:

100000
91 -43 -73 29
9 -7 -73 29
26 25 -20 71
81 -30 73 -22
86 60 65 -5
44 -70 86 60
34 3 -65 23
34 3 -65 23
-8 0 14 99
-20 -54 14 99
-36 5 21 -43
-74 37 59 -75
35 45 -66 -90
-66 -90 35 45
-78 -39 27 -52
27 -52 -78 -39
47 30 -10 -83
-10 -83 47 30
-94 17 55 -63
-94 17 55 -63
15 -20 55 -86
35 -53 15 -...

output:

59.702968472634963648
104.651803615609033618
45.538750287834840604
33.666666666666666671
49.532454535259825942
46.130471579675676519
56.200039541306769843
35.267233769857507467
42.187412551349694954
56.372767263004650989
25.725041842099650464
25.510346484863308841
40.706264874095240427
35.3774292452...

result:

ok 100000 numbers

Test #13:

score: 0
Accepted
time: 262ms
memory: 3676kb

input:

100000
34 -90 -37 73
-37 73 34 -90
13 -85 60 15
60 15 13 -85
-58 -54 -95 58
-95 58 -58 -54
-3 -70 96 -52
96 -52 74 -56
-59 81 -25 16
-25 16 9 -49
-98 54 40 50
-98 54 40 50
-90 53 6 -50
-90 53 6 -50
-79 22 -27 -18
-79 22 51 -78
3 -25 42 -1
3 -25 -88 -81
-17 46 -79 -40
14 89 -79 -40
-40 18 -8 -2
-8 -2...

output:

59.264004439644662119
36.831447915545698187
39.317793540442842214
40.787536256246163916
73.355299740373224107
46.019319614459509929
46.933759467762411265
57.950975449560428912
76.321687612368740126
50.064464615972381505
28.301943396169811435
32.743107841362754661
38.042374035044424687
40.31128874149...

result:

ok 100000 numbers

Test #14:

score: 0
Accepted
time: 582ms
memory: 3672kb

input:

100000
-43 -66 58 -73
53 59 57 45
57 9 -87 34
-60 -16 23 8
-85 29 60 -50
-60 64 61 -5
17 66 -58 52
95 1 -21 74
-43 -29 52 21
6 6 56 -2
-9 -50 -37 30
-41 -56 -69 41
52 50 42 6
-10 -26 46 85
66 80 35 -54
-3 95 6 7
-49 34 42 47
84 23 -5 -5
46 39 61 24
-61 -35 -96 76
98 -16 81 -35
-5 34 -53 -47
23 -82 -...

output:

133.422687496635250723
50.644821221567607662
69.955105650865347440
65.811674713319571098
37.060285155582096905
46.813610979718531951
45.083939963339191841
74.735619795525003083
61.806243114661328291
136.507674639486433293
122.814089323194422759
92.257707076593584251
63.249310239638678120
163.5891012...

result:

ok 100000 numbers

Test #15:

score: 0
Accepted
time: 415ms
memory: 3668kb

input:

100000
7 -57 -48 -29
-8 -36 -48 -29
12 96 28 -93
-47 58 28 -93
-63 -41 -69 60
-10 -21 -63 -41
43 -57 -69 58
-69 58 -74 34
82 -68 61 98
40 -60 82 -68
-46 87 -75 -25
-75 -25 -56 25
92 90 75 88
-27 76 58 -29
50 -100 68 60
60 -93 50 -100
83 -50 76 77
83 -50 -75 80
-80 -69 63 -80
13 58 11 -76
-95 -9 -6 -...

output:

21.467415419389914077
72.540916222135100801
55.550961539625282146
75.739380141989641776
83.071435678364981957
39.777700256263796977
101.947714522290301162
77.083991374078019702
94.066474164548045715
82.129527055424900520
82.889437065662449018
57.732847783009362902
63.883992880712208984
58.6358206109...

result:

ok 100000 numbers

Test #16:

score: 0
Accepted
time: 277ms
memory: 3668kb

input:

100000
-53 -68 -69 -15
-53 -68 -69 -15
35 50 -61 -2
35 50 -61 -2
-52 91 77 -4
-52 91 77 -4
-7 -86 -79 -47
-7 -86 -79 -47
-45 46 -50 90
-50 90 -45 46
-25 -2 -32 -58
-25 -2 -32 -58
71 20 82 23
82 23 71 20
-97 94 64 51
64 51 -97 94
-26 -87 -1 -16
-1 -16 -26 -87
-58 30 -21 -28
-21 -28 -58 30
-26 -90 -63...

output:

18.454147380888545282
36.392917503883148340
53.402039078838345214
27.294688127912361257
14.761059883656352435
18.811934746029949191
3.800584750330459930
55.547777233257097776
25.090945688745084755
22.932267417089154659
38.054055120461355521
16.606558276108200796
19.846634195472261208
50.982567826878...

result:

ok 100000 numbers

Test #17:

score: 0
Accepted
time: 582ms
memory: 3688kb

input:

100000
541 17 967 -860
-970 -232 419 -236
-905 -139 -974 -189
24 267 -912 974
207 -639 398 -939
-31 -897 -527 -91
109 357 234 -959
-778 -920 -4 43
645 395 522 372
773 547 563 712
-777 -353 183 -700
218 562 -17 111
924 41 71 -664
-756 845 -939 103
-601 739 584 -670
-481 158 454 -810
-189 -92 -417 -66...

output:

1077.388887977491320092
986.154539459444461347
675.175454690693863213
731.446775039412460662
271.783669719025416878
994.707291771485165754
1599.696102060808436507
655.579132413669510959
1290.257232189614731488
500.634041959813706202
1131.040173433251916912
1252.726588287086412543
736.804586666694567...

result:

ok 100000 numbers

Test #18:

score: 0
Accepted
time: 375ms
memory: 3676kb

input:

100000
344 -566 -889 -145
418 -90 344 -566
-221 -485 -190 757
-221 -485 116 -337
-166 159 -185 697
-166 159 307 -455
-587 728 197 -273
-587 728 -74 -682
-926 913 318 -963
847 -224 318 -963
979 -674 792 574
-250 454 792 574
339 165 420 -963
420 -963 -923 606
-44 939 28 767
964 -974 -44 939
934 -842 9...

output:

692.587570590207424803
601.720709775958579602
631.819135731127081601
543.747869276599520072
1141.297157296726791920
897.087116431048697374
850.446807574503564509
993.820852795342945307
668.224532617654928879
237.791893929826196455
317.797310510197202754
248.830054765850921084
843.116541423358377305
...

result:

ok 100000 numbers

Test #19:

score: 0
Accepted
time: 270ms
memory: 3736kb

input:

100000
249 365 292 977
292 977 163 -859
-939 -821 521 351
521 351 156 58
109 21 -421 -294
109 21 -951 -609
599 873 -452 388
-452 388 599 873
755 -589 -780 97
-780 97 755 -589
-122 556 860 -72
369 242 860 -72
-529 834 -340 752
-340 752 227 506
-481 -801 -193 -813
263 -832 -1 -821
78 -169 -301 143
-30...

output:

681.676401270707563396
741.084574945547103875
411.028520232409717461
385.836177095351642669
560.438419652170368768
388.545435638556376473
412.043687004181633071
468.406073829108240802
327.268153727863421093
487.844806834669047324
773.056918991092142990
156.553150363986252447
264.639167337128857010
6...

result:

ok 100000 numbers

Test #20:

score: 0
Accepted
time: 268ms
memory: 3680kb

input:

100000
912 -157 133 -554
133 -554 912 -157
-48 -679 -180 -647
-180 -647 -147 -655
-238 181 -27 333
-27 333 -449 29
107 278 808 844
-594 -288 107 278
-261 -116 507 229
507 229 -261 -116
-191 147 823 -838
-191 147 823 -838
170 -405 -629 -119
170 -405 969 -691
242 887 -621 -246
242 887 -621 -246
730 42...

output:

291.442771207125480321
53.763435013440542300
173.365381652611244598
900.975582355038076887
280.643902481418612477
471.218397113034815127
848.644212847763429575
474.746482053550579283
402.161106467986975532
666.687499674489338852
217.988711003574678227
357.430956813884391471
514.075329542708599040
21...

result:

ok 100000 numbers

Test #21:

score: 0
Accepted
time: 579ms
memory: 3680kb

input:

100000
188 593 -923 -569
527 -406 -314 383
925 -781 -643 79
68 -89 -997 951
-691 -611 -189 124
-863 -526 -142 -22
-657 -960 980 397
11 -891 -435 181
216 -951 -407 -624
954 726 555 -876
-66 734 355 502
566 -400 -983 -657
417 -546 599 -858
183 -675 -599 301
782 144 -849 -434
-634 -83 620 207
961 -786 ...

output:

674.208276670028770150
1056.720401249563930701
311.654867962955263783
714.636567871482874026
1164.816309948222119441
1274.091439263621950650
891.565373048437062875
570.655759763484441816
966.174623563185955288
1218.861856748169314568
537.988061194552690258
1086.364472652801368313
1227.39344574788138...

result:

ok 100000 numbers

Test #22:

score: 0
Accepted
time: 420ms
memory: 3756kb

input:

100000
-750 -751 -173 134
680 936 -750 -751
-324 -818 78 196
-56 -142 553 576
-385 968 443 131
-588 288 811 -241
-652 -352 149 771
-652 -352 -67 131
363 -636 -888 -192
533 -371 -888 -192
148 841 407 762
532 792 407 762
747 810 438 490
-480 -268 -489 -470
-149 920 -153 -200
-155 -760 -312 -774
860 -9...

output:

756.692625540690061214
668.264226747236337989
707.760535007333220214
478.444111982536424449
502.737922490817419008
194.597806683810508555
1483.235394330065864965
1131.249465590583123786
1485.945304173072227472
607.103926633511091382
645.865525219755165998
737.668438251976757769
830.46701978648874770...

result:

ok 100000 numbers

Test #23:

score: 0
Accepted
time: 277ms
memory: 3688kb

input:

100000
-802 -93 -8 607
-802 -93 -8 607
-861 338 748 -826
-861 338 748 -826
559 912 -927 -473
559 912 -927 -473
381 40 -776 -706
381 40 -776 -706
340 -550 -421 -502
-421 -502 340 -550
895 -134 75 912
75 912 895 -134
-178 -448 242 763
-178 -448 242 763
995 56 -708 -699
-708 -699 995 56
-149 570 -999 3...

output:

352.835498340074746104
661.964836259785361527
677.119799018033604376
458.883306395960419599
254.170764994280523941
443.034485740732778408
427.254933005784940603
620.952136283913235126
294.960637675229095600
229.987922388208125793
403.068783763323011893
181.502372191415479369
329.795391113945071782
5...

result:

ok 100000 numbers

Test #24:

score: 0
Accepted
time: 445ms
memory: 3688kb

input:

100000
774 -797 772 -799
-831 601 -831 600
305 -123 307 -124
-251 -445 -251 -443
429 654 429 652
160 972 158 971
-741 979 -739 980
128 793 126 791
-288 173 -286 171
-922 989 -922 987
351 405 351 406
289 -675 290 -677
-671 38 -669 40
109 898 108 899
-485 803 -485 802
-84 -604 -83 -604
-810 -556 -808 ...

output:

2128.055206262810517881
642.627255905013275217
417.543749320377659329
887.043338534065759271
1033.963798175749266295
1083.247249385787026155
1159.656271438407588614
1462.684034005041395554
1079.078619316889026569
1280.991929078545445986
376.522465022626000392
1844.758684940438987931
650.380757818410...

result:

ok 100000 numbers

Test #25:

score: 0
Accepted
time: 458ms
memory: 3732kb

input:

100000
838 139 848 133
-348 -703 -329 -683
85 483 76 466
-11 470 -7 475
11 857 12 858
209 465 191 458
289 331 270 315
375 53 389 42
-456 -466 -476 -447
-41 118 -21 133
306 -630 303 -614
-688 -257 -703 -243
409 -809 397 -820
-376 449 -379 464
307 -718 326 -731
-167 13 -166 -4
-293 -514 -307 -504
327 ...

output:

1443.327819608882192637
89.664930892755799814
438.610662549272845218
294.039562955965854879
726.646869193345403104
1066.960827747158154888
1491.524344522349500242
874.495482233949701423
806.061596839178945373
355.627132806735825943
1016.715075516236792830
1133.719572006711185264
1395.029276062253663...

result:

ok 100000 numbers

Test #26:

score: 0
Accepted
time: 478ms
memory: 3676kb

input:

100000
-849 -426 -958 -542
591 741 536 872
137 144 30 208
-65 -890 34 -865
-848 965 -982 888
571 563 473 575
634 436 491 422
106 -606 -88 -456
-754 -615 -579 -650
-750 431 -885 432
-716 145 -614 226
744 13 767 -130
484 469 455 416
-431 125 -337 -18
850 943 651 808
468 -244 366 -349
152 -355 -22 -203...

output:

1954.228978105588164005
1059.003861962645254291
1481.129275393588549337
1110.862188749129659038
1076.448877478024867660
1442.118782777037127141
939.294718171287844499
1219.511809833435582395
1281.365579249667382755
620.155741031846015121
985.291025898863842614
745.874942198439452701
1019.80379999558...

result:

ok 100000 numbers

Test #27:

score: 0
Accepted
time: 622ms
memory: 3732kb

input:

100000
779 476 858 385
763 758 -781 -760
-942 873 125 -978
-941 814 830 -654
793 794 -884 -602
-757 720 -808 -830
-399 -322 351 613
-771 -341 554 804
674 -821 413 33
-985 590 -803 -782
415 961 540 -981
-534 -861 521 465
18 589 -520 916
559 -852 972 402
53 246 -606 739
511 -989 -148 -487
489 896 -181...

output:

981.624125030525891633
866.367986249116862840
969.871725496647500098
533.148428974791969481
1532.609584915468914801
822.844217388271017111
1452.875212585088146700
1326.826208587961110963
740.521997608807364732
833.741732660016734657
1200.738293976584684986
961.075120980634175882
1028.980058346836473...

result:

ok 100000 numbers

Test #28:

score: 0
Accepted
time: 436ms
memory: 3788kb

input:

100000
521 -728 519 -728
-162 774 -162 772
237 876 235 876
16 -531 16 -533
321 -378 321 -380
-445 968 -443 968
124 -293 122 -293
173 251 173 249
264 841 266 841
210 617 210 619
-648 324 -648 322
126 -284 128 -284
393 -118 393 -120
-804 -335 -802 -335
265 989 265 987
540 -922 542 -922
-477 114 -479 1...

output:

1648.673810471133613476
1425.083974133947482432
1549.075315578086613044
545.297472333793087351
229.683115040432911297
984.415731961527799343
1215.348646822546536894
1929.838421561073515953
890.056365256365403238
1527.409680908610666750
682.440717816217153224
1575.633629157918820018
241.3738455877239...

result:

ok 100000 numbers

Test #29:

score: 0
Accepted
time: 431ms
memory: 3756kb

input:

100000
897 739 897 759
13 480 15 480
-841 -220 -841 -200
850 -190 852 -190
-191 -980 -191 -1000
470 -539 468 -539
-89 222 -89 202
-621 -319 -623 -319
306 -482 306 -462
570 -816 572 -816
103 -486 103 -466
468 264 470 264
-264 -4 -264 16
960 667 962 667
-484 -137 -486 -137
255 557 255 537
-580 -481 -5...

output:

923.082082348582928066
1692.128047356226103748
799.389660667017883267
752.374172957147655305
434.250648435273307379
825.568179950592924199
1391.966914789646364570
1007.707363027531440924
692.449716341228264149
2011.878589857442143907
1546.166997023863555971
1072.783939825043176497
1535.8439936221172...

result:

ok 100000 numbers

Test #30:

score: 0
Accepted
time: 440ms
memory: 3796kb

input:

100000
-875 312 -875 512
74 -22 76 -22
456 351 456 151
33 995 35 995
-64 374 -62 374
-69 652 -69 452
-109 758 -107 758
-169 -760 -169 -960
9 258 9 458
-650 -516 -652 -516
-951 -104 -951 -304
966 314 968 314
130 996 130 796
-795 949 -793 949
131 737 129 737
-766 476 -766 276
636 -90 638 -90
-535 -565...

output:

1045.760510333913512859
855.825038673963297775
178.115376566587238244
1619.151035341418608970
1095.760172926254193748
1987.499581101598449262
927.310582104293583794
967.473850235679697529
1306.482567081908098716
814.247625934593748487
1407.220066011960014185
779.377072642718488671
954.14552277846127...

result:

ok 100000 numbers

Test #31:

score: 0
Accepted
time: 490ms
memory: 3736kb

input:

100000
523 -62 525 -62
-256 -1000 -256 1000
74 1000 74 -1000
590 -824 588 -824
996 621 998 621
78 -1000 78 1000
-291 -265 -293 -265
-638 -1000 -638 1000
601 1000 601 -1000
121 455 119 455
-542 1000 -542 -1000
-111 -565 -113 -565
-280 -669 -282 -669
98 -1000 98 1000
-901 -392 -903 -392
119 1000 119 -...

output:

960.350054144634929898
1041.544738384720838020
1215.504188566770849333
668.942839880682066478
818.345050504472153796
835.242068061042464255
862.669742322685088376
1219.582807086224703674
1021.598350772996635860
592.817878248619281378
970.977291724186673427
645.147160878495100289
1484.872966239411390...

result:

ok 100000 numbers

Test #32:

score: 0
Accepted
time: 442ms
memory: 3684kb

input:

100000
348 475 348 495
869 956 889 956
-147 -417 -127 -417
-196 542 -196 522
859 -89 859 -69
52 -872 72 -872
-169 787 -189 787
166 -910 166 -890
-71 -161 -71 -141
693 153 673 153
239 965 259 965
245 -35 245 -55
-572 -551 -592 -551
189 189 189 209
-191 701 -191 721
833 494 813 494
-575 -961 -555 -961...

output:

709.813590647042796600
950.849795868086097583
1124.318163767407236953
1721.925472716461369416
812.997745428399006262
1010.024422578304559239
1075.627413829676606416
1036.975570604331260194
2360.498534917645748310
1353.160128668591177137
979.417344119854315521
1329.069724797730228660
632.422590913173...

result:

ok 100000 numbers

Test #33:

score: 0
Accepted
time: 440ms
memory: 3792kb

input:

100000
135 -772 115 -772
-720 185 -720 385
786 -969 766 -969
-560 -361 -560 -161
-726 369 -746 369
238 992 238 792
471 -279 471 -79
-506 -446 -486 -446
611 500 611 700
150 -770 130 -770
-434 -689 -434 -889
-485 -790 -505 -790
-875 -658 -875 -858
305 115 325 115
486 725 486 925
224 -272 204 -272
820 ...

output:

1353.734242093175293098
1512.868357635561488483
1106.707510317249702259
1004.727340749605694892
1448.835414708064245670
82.264078490164534906
1476.620919064840960933
1130.317817675095335095
1273.980128639457694462
886.029149822846119500
913.982470165372521465
968.046292754520206092
1176.439751169791...

result:

ok 100000 numbers

Test #34:

score: 0
Accepted
time: 496ms
memory: 3676kb

input:

100000
-152 1000 -152 -1000
-564 214 -584 214
691 423 711 423
976 -1000 976 1000
182 896 162 896
80 1000 80 -1000
-350 1000 -350 -1000
375 -245 395 -245
-69 1000 -69 -1000
695 541 715 541
154 -1000 154 1000
314 -422 334 -422
839 986 819 986
226 -1000 226 1000
690 168 710 168
-275 -1000 -275 1000
-41...

output:

706.037034638501616646
680.281035869351562440
913.320351118371330124
945.764002180157625665
1067.512077777218714836
630.583551664361610600
1208.114227411675318025
1135.904082433193082347
1213.196464618120213985
731.926505849868326403
1432.290376523548326659
1357.928734810588850657
939.38754444718875...

result:

ok 100000 numbers

Test #35:

score: 0
Accepted
time: 454ms
memory: 3792kb

input:

100000
270 947 270 747
481 -496 281 -496
343 -718 343 -918
618 -836 818 -836
-875 367 -875 567
762 644 962 644
725 -196 525 -196
760 79 760 -121
-855 505 -655 505
-59 -736 -59 -536
-366 238 -166 238
-625 -517 -625 -317
-975 -1000 -975 -800
-979 71 -779 71
-197 -525 3 -525
91 274 91 74
-300 215 -100 ...

output:

1348.817297884707043565
379.927000483988356605
1746.949952771794842832
228.505484559953328513
1337.771141337922628733
749.162665744491611086
977.445307596500399139
726.148265366827971368
555.412550795579030016
480.858627355748436072
873.539323447609133311
1093.314580040030571273
1217.379888523914444...

result:

ok 100000 numbers

Test #36:

score: 0
Accepted
time: 499ms
memory: 3740kb

input:

100000
-665 947 -465 947
-789 -1000 -789 1000
597 621 397 621
948 1000 948 -1000
300 1000 300 -1000
-273 -96 -73 -96
215 -1000 215 1000
64 486 -136 486
-156 635 44 635
-644 1000 -644 -1000
-97 961 103 961
38 -1000 38 1000
486 1000 486 -1000
383 -728 183 -728
-816 989 -616 989
-627 -1000 -627 1000
12...

output:

997.372991323113551543
878.740469671616530767
725.335783024035153255
697.212296334950125398
975.759483554773241032
967.467252247786601627
817.116507518556114520
1000.446906011734520991
554.619956547486814502
905.523214448851212321
634.059712297156037819
662.587726797098134357
940.988468516774948902
...

result:

ok 100000 numbers

Test #37:

score: 0
Accepted
time: 616ms
memory: 3736kb

input:

100000
-501 1000 -501 -1000
-1000 397 1000 397
-1000 380 1000 380
404 -1000 404 1000
-1000 -818 1000 -818
997 1000 997 -1000
1000 -447 -1000 -447
-851 1000 -851 -1000
665 1000 665 -1000
1000 560 -1000 560
1000 801 -1000 801
-256 -1000 -256 1000
1000 841 -1000 841
-864 1000 -864 -1000
649 1000 649 -1...

output:

940.489730256392045371
897.987853749602323694
1418.646011640920742924
1150.514777833116830341
1081.809528156734716564
1066.092167557112686427
1344.503302120963798671
1065.978493829925788039
1141.905762016028661576
1107.059862952917999146
1059.286039509906608536
1186.830705710507387840
884.8401661670...

result:

ok 100000 numbers

Test #38:

score: 0
Accepted
time: 471ms
memory: 3792kb

input:

100000
601 668 600 667
-269 235 -271 237
-679 521 -678 521
119 850 119 852
-580 652 -581 654
427 -652 425 -653
-166 980 -165 979
793 324 791 322
509 903 510 902
-836 -298 -837 -299
284 405 286 406
992 -469 993 -471
-671 38 -669 40
899 -465 898 -464
-485 441 -485 443
-288 -943 -287 -943
-810 -556 -80...

output:

971.577642613438586028
863.079687389947955656
1648.445606220194443514
1160.947522440753840067
1803.917172895322008630
1125.636227502804368017
1647.332711438770008527
1399.010842815611830980
1089.201136265140923198
1220.780556310852715929
528.309569335600513751
547.271944939040522415
347.555631040189...

result:

ok 100000 numbers

Test #39:

score: 0
Accepted
time: 455ms
memory: 3672kb

input:

100000
217 840 197 859
150 347 169 367
-647 887 -652 891
208 -751 224 -731
-463 580 -451 592
-776 283 -790 297
701 651 690 637
-632 753 -618 742
968 721 983 701
-198 56 -182 68
-125 191 -111 206
-917 766 -932 780
518 520 523 521
203 -624 199 -604
-64 442 -81 441
-292 640 -291 623
-416 75 -400 83
51 ...

output:

494.849389417668840935
1845.545136554728310019
440.368765320239759359
1324.559895486344079707
1334.032605378170615373
990.215928105335769893
1178.634541741846866292
289.974424765836134826
503.285875239619060917
1291.718848440085802620
1431.553555890128051065
647.732327870091853683
1052.7781898311399...

result:

ok 100000 numbers

Test #40:

score: 0
Accepted
time: 473ms
memory: 3792kb

input:

100000
360 -274 251 -390
-598 257 -714 366
209 746 102 810
436 773 372 666
-540 -573 -552 -671
182 -519 84 -507
862 -174 719 -188
105 -283 119 -426
-650 -949 -615 -956
627 -445 635 -405
390 522 247 499
914 -544 937 -687
-560 -529 -618 -635
249 698 196 727
282 45 247 79
894 227 860 192
-295 664 -273 ...

output:

1157.880961046077822107
257.845188657209231253
688.284209161774867158
701.562066646188421726
1369.239577659912644791
1279.872697215197198450
1527.929979140815701322
630.167386775684664091
401.716373486693777262
728.480744785159409160
519.825049388961862362
1531.225946016455595866
1241.19686281584884...

result:

ok 100000 numbers

Test #41:

score: 0
Accepted
time: 662ms
memory: 3792kb

input:

100000
69 -340 543 -886
-853 -970 -307 -496
-519 -788 949 983
-993 537 778 -931
790 506 -887 -890
783 -859 -613 818
-161 -680 -619 -150
-867 -894 723 480
-215 -884 -737 824
804 879 -904 357
-856 472 470 -583
-513 -352 542 974
765 -365 -489 48
584 -439 997 815
559 995 -947 -982
962 -723 -356 281
446 ...

output:

918.386641172294156399
952.787966755925783302
853.879811765924891076
644.960743831068091803
965.481696478470074463
739.693166773890230070
839.425663577989094377
941.417022041016200218
670.531614377623741585
519.569267209387288142
987.687625726558681427
954.936945462393766748
772.162011363009792353
1...

result:

ok 100000 numbers

Test #42:

score: 0
Accepted
time: 382ms
memory: 3676kb

input:

100000
601 668 600 667
-271 235 -269 237
321 -123 321 -124
119 850 119 852
264 -750 266 -749
427 -652 425 -653
-165 980 -166 979
793 324 791 322
509 903 510 902
-836 -299 -837 -298
11 -656 12 -658
992 -469 993 -471
-671 40 -669 38
899 -465 898 -464
-963 -915 -961 -915
-288 -943 -287 -943
-808 -556 -...

output:

971.577369573584102902
995.215688765780425729
187.962775935997194299
1160.947589395950527047
1803.917218792683119788
998.664494092325051744
1647.332593664920819432
675.080921606286562919
1089.200893182331203568
1220.780509792773961708
528.309622578013378225
918.994867526171769379
957.449596283007039...

result:

ok 100000 numbers

Test #43:

score: 0
Accepted
time: 391ms
memory: 3796kb

input:

100000
-682 -147 -663 -127
150 347 169 367
378 94 382 99
208 -751 224 -731
-463 580 -451 592
-790 283 -776 297
234 575 220 586
-632 753 -618 742
-456 3 -476 -12
-198 56 -182 68
981 -957 996 -971
-917 766 -932 780
574 121 575 116
203 -624 199 -604
304 329 303 346
-292 640 -291 623
5 106 13 90
51 286 ...

output:

967.610133233828811739
853.413558746813397993
440.331842600628554862
868.218832439233673570
283.921937713500707717
2583.938469312616288187
822.236381030201884057
663.699855296420631379
198.808734693292677109
1276.233746373291835341
514.590973642146138012
1160.784557616292627880
416.85131043540979081...

result:

ok 100000 numbers

Test #44:

score: 0
Accepted
time: 392ms
memory: 3752kb

input:

100000
360 -274 251 -390
434 181 543 297
209 746 102 810
-240 98 -347 162
-63 -698 -161 -686
182 -519 84 -507
862 -174 719 -188
-475 -282 -618 -296
-650 -949 -615 -956
-514 -953 -474 -961
-486 313 -509 456
914 -544 937 -687
-560 -529 -618 -635
-460 722 -431 775
865 -396 899 -361
894 227 860 192
324 ...

output:

600.272768298377583596
789.987753428018097179
304.697067157617072553
1341.355283850666114454
138.597623701728315304
1739.748811540414194177
1338.299718509983089354
588.188128470525708524
604.198072200113341090
1314.849430606606876859
864.451629923290376212
1385.450263061242951679
1121.56652537851570...

result:

ok 100000 numbers

Test #45:

score: 0
Accepted
time: 436ms
memory: 3728kb

input:

100000
69 -340 543 -886
-529 -436 -55 -982
-958 783 813 -685
-993 537 778 -931
790 506 -887 -890
-742 -654 935 742
-564 -478 -34 -20
-867 -894 723 480
-215 -884 -737 824
-327 -987 -849 721
254 505 -801 -821
-513 -352 542 974
-957 -860 -544 394
584 -439 997 815
997 -829 -980 677
962 -723 -356 281
446...

output:

658.047651072043164489
824.887253225754819019
769.333695532314670751
585.410548843522447526
627.188961710990391607
729.223226125519172480
1662.046761050918752378
761.557662296938020163
715.555210849871024759
795.560526373540113865
854.163252523556908946
844.443152464279046587
922.972023963768239685
...

result:

ok 100000 numbers

Test #46:

score: 0
Accepted
time: 423ms
memory: 3732kb

input:

100000
667 803 668 805
-31 132 -30 132
-679 521 -678 521
280 -418 279 -418
-904 -471 -904 -470
158 971 160 972
558 787 558 786
-741 979 -739 980
-100 379 -100 378
-113 295 -112 294
351 405 351 406
-679 -508 -679 -507
716 176 716 175
-465 -155 -464 -154
-183 -145 -182 -145
-84 -604 -83 -604
412 111 4...

output:

968.910773299207655262
1341.448874040432633459
1791.461167718887767752
1312.270253706549123285
84.925611013555851347
1376.397142300524311875
1225.757058887732607877
469.555278170601375465
523.289616662723370444
454.911294518230797407
1065.496346458260192414
1785.238405528855947901
306.03010663075479...

result:

ok 100000 numbers

Test #47:

score: 0
Accepted
time: 459ms
memory: 3796kb

input:

100000
-329 -683 -348 -703
287 144 286 145
591 -422 592 -421
836 -803 832 -800
12 858 11 857
-974 93 -974 94
-948 769 -949 767
729 -64 718 -59
421 499 418 488
-615 -39 -611 -40
-447 -64 -466 -68
615 939 616 934
-934 706 -935 712
385 306 368 303
-820 466 -809 452
-514 295 -509 299
928 307 923 326
324...

output:

1045.003493758388904200
450.784501152473724206
1246.958822367540875575
1866.455110803679068310
1161.960303009791452555
1467.719402077706817078
1371.987203915847807645
343.598834879490925620
639.309103285882035395
1442.222511617070635825
1074.875181292327314009
664.023112704492240010
1428.34829095493...

result:

ok 100000 numbers

Test #48:

score: 0
Accepted
time: 473ms
memory: 3736kb

input:

100000
-958 -542 -849 -426
-276 -395 -309 -364
-734 -761 -852 -566
-866 -267 -904 -290
-254 -414 -191 -607
943 390 894 374
888 421 965 381
-608 635 -621 610
-564 106 -563 -88
89 490 88 490
927 -657 928 -659
-650 -374 -615 -357
-100 744 -300 767
-562 296 -572 209
878 -77 885 -97
-143 484 -226 455
873...

output:

620.581477223259415865
396.561015793673922347
1449.654464144128167669
1556.878469810336251933
811.490173181234045907
1587.199171985095177417
624.831416206945297331
1202.667221040450354130
1497.848089663315749087
1888.787621382427945216
743.938897386152915847
614.899720986474634887
1882.6655870193998...

result:

ok 100000 numbers

Test #49:

score: 0
Accepted
time: 584ms
memory: 3676kb

input:

100000
585 958 547 925
779 476 858 385
955 -480 19 -743
-955 999 -395 -994
-867 248 32 950
-976 197 -723 -127
840 -84 739 -683
921 928 749 957
-322 134 613 -278
131 -356 324 82
570 877 561 962
-959 -985 760 -803
517 415 -756 540
-998 -711 -960 -324
-472 211 -229 530
511 -989 -148 -487
-720 -893 986 ...

output:

570.222150479631462172
1404.032519662618108791
728.053022820899804035
1327.942912287972118235
309.132459139311805835
1983.387140013556257045
1351.530962001989474297
1238.882356576839146367
679.305359930400934121
990.131803626760992332
899.672244930068104707
1572.782527828717089147
1036.9349748631083...

result:

ok 100000 numbers

Test #50:

score: 0
Accepted
time: 450ms
memory: 3732kb

input:

100000
667 803 668 805
-831 600 -831 601
321 -124 321 -123
280 -418 279 -418
-652 497 -653 497
158 971 160 972
-878 -419 -877 -419
-741 979 -739 980
279 -411 280 -411
-113 295 -112 294
351 405 351 406
-49 -833 -50 -833
728 957 729 957
-465 -155 -464 -154
-943 -399 -943 -398
-84 -604 -83 -604
-18 -23...

output:

1512.254894580574884788
297.409790244691191519
940.043894195966545646
1405.243352952075910678
807.090036023447665148
1301.646105257978375369
1630.546316095020845660
883.725400412001764250
164.507092046083290698
1003.433836915866457729
561.932632550136201888
1119.117770090973982944
857.61263411757170...

result:

ok 100000 numbers

Test #51:

score: 0
Accepted
time: 449ms
memory: 3740kb

input:

100000
-329 -683 -348 -703
287 145 286 144
592 -422 591 -421
836 -803 832 -800
12 858 11 857
829 360 828 360
-38 33 -36 32
729 -64 718 -59
421 499 418 488
-306 735 -305 739
-447 -64 -466 -68
879 882 884 883
-244 937 -250 936
385 306 368 303
-820 466 -809 452
-619 -138 -623 -133
928 307 923 326
442 1...

output:

1045.003417307697806460
450.784333489123686861
956.553934658883476261
766.288055690586955015
764.806808929024804389
1640.091943154099400015
887.803545798110456344
625.200810013125605924
505.719078055595208598
1631.083464931751782157
1055.282867635568962439
610.403739787498672564
828.4489781199996599...

result:

ok 100000 numbers

Test #52:

score: 0
Accepted
time: 453ms
memory: 3680kb

input:

100000
-958 -542 -849 -426
16 -48 -15 -81
-734 -761 -852 -566
-760 663 -737 625
-254 -414 -191 -607
-753 -878 -737 -927
888 421 965 381
399 -273 424 -286
-564 106 -563 -88
996 938 996 937
416 -731 418 -730
-650 -374 -615 -357
-100 744 -300 767
-748 43 -661 33
589 -67 609 -60
-143 484 -226 455
873 85...

output:

996.752058663853838016
1308.771594041047193091
655.703031267208172883
853.802765846101736846
1815.621936458108821144
1111.187984057126656889
878.879794770956100092
947.840554621049805273
845.610492501913933450
1171.706969459846248260
579.105278188884792567
1399.881253314699505741
1107.87256952464657...

result:

ok 100000 numbers

Test #53:

score: 0
Accepted
time: 496ms
memory: 3756kb

input:

100000
680 652 713 614
779 476 858 385
607 338 870 -598
-955 999 -395 -994
-867 248 32 950
-876 92 -552 345
840 -84 739 -683
-58 -374 -87 -546
-322 134 613 -278
-328 768 -766 961
-530 94 -615 85
-959 -985 760 -803
517 415 -756 540
100 640 -287 678
-535 697 -854 940
511 -989 -148 -487
-720 -893 986 8...

output:

236.504868371218661349
1547.012784603139704864
514.280980198303035833
883.127281654343011363
1177.358728834975022171
1188.325676045419361460
393.649163123877846387
1789.300303347872408422
816.584304816125572668
953.105941805297940173
597.477250484479308068
800.945321432895293579
1218.847893385824189...

result:

ok 100000 numbers

Test #54:

score: 0
Accepted
time: 394ms
memory: 3680kb

input:

100000
-1000 -998 -999 -1000
1000 999 1000 1000
-1000 -1000 -999 -998
1000 1000 1000 999
-1000 -998 -999 -1000
1000 1000 1000 999
999 1000 1000 1000
-1000 -999 -1000 -1000
999 1000 1000 1000
-1000 -999 -999 -1000
-1000 -999 -998 -1000
999 1000 1000 1000
1000 999 1000 1000
-999 -998 -1000 -1000
-1000...

output:

2827.013073325695507787
2827.013014370133764608
2827.013073325695507787
2827.720032700626143773
2827.366523524303895787
2827.013073325080449116
2827.013014369991310115
2827.013073325080449338
2827.013014370055961511
2827.013014370055961288
2827.013014370133764608
2827.720032700626393130
2827.0130143...

result:

ok 100000 numbers

Test #55:

score: 0
Accepted
time: 431ms
memory: 3788kb

input:

100000
-1000 1000 -1000 999
1000 -990 999 -1000
998 -1000 1000 -989
-999 1000 -1000 995
-1000 1000 -1000 999
1000 -1000 999 -989
1000 -987 999 -1000
-1000 999 -1000 1000
-1000 1000 -1000 999
1000 -1000 999 -993
999 -1000 1000 -981
-1000 1000 -1000 999
-1000 999 -1000 1000
1000 -987 999 -1000
999 -10...

output:

2824.187598897174417134
2821.714870571388152021
2823.834356372406031443
2823.129023134547332274
2825.246501677955858867
2821.013475684784028275
2823.129023134538149398
2821.718420215257089989
2825.953076923083469696
2825.952486930059217585
2820.656652285902626920
2826.659593692727120207
2827.7200327...

result:

ok 100000 numbers

Test #56:

score: 0
Accepted
time: 435ms
memory: 3732kb

input:

100000
-998 1000 -1000 957
999 -1000 1000 -979
-1000 1000 -999 846
1000 -999 1000 -1000
-1000 938 -999 1000
1000 -1000 1000 -999
-1000 828 -999 1000
1000 -999 1000 -1000
1000 -1000 999 -914
-1000 1000 -998 827
-1000 1000 -999 999
1000 -1000 999 -1000
1000 -1000 1000 -999
-1000 861 -999 1000
-1000 80...

output:

2804.840861224039835431
2773.990071039219097671
2805.915255960805666957
2767.812139266655112158
2737.589335836214676778
2827.366494049906701980
2779.162742895567455914
2758.918989403743302402
2743.717523878576667773
2781.836533409625979996
2796.489837186993692830
2761.650628111865524827
2821.0129144...

result:

ok 100000 numbers

Test #57:

score: 0
Accepted
time: 437ms
memory: 3684kb

input:

100000
1000 1000 998 923
-1000 -1000 -999 -962
-1000 -999 -1000 -1000
1000 1000 999 -934
-1000 -1000 -1000 -999
1000 85 999 1000
999 -370 1000 1000
-1000 -999 -1000 -1000
-1000 -923 -999 -1000
998 1000 1000 845
-1000 -229 -999 -1000
998 1000 1000 -543
1000 -527 999 1000
-1000 -1000 -1000 -999
-1000 ...

output:

2787.042997358372055983
2304.983272385044473340
2533.741404724793063075
2415.818021822519682695
2746.782235640132005194
2217.191682224854049510
2380.765997941619015466
2433.127118759238262102
2522.913009868200178598
2338.996939369722962265
2740.657589827734526233
2767.325554256834213351
2400.8234801...

result:

ok 100000 numbers

Test #58:

score: 0
Accepted
time: 430ms
memory: 3680kb

input:

100000
1000 999 999 1000
-996 -1000 -1000 -995
999 1000 1000 998
-997 -1000 -1000 -995
-998 -1000 -1000 -991
999 1000 1000 996
-995 -994 -1000 -1000
1000 1000 999 999
998 1000 1000 993
-1000 -982 -995 -1000
1000 1000 999 993
-1000 -1000 -997 -980
1000 1000 1000 999
-1000 -1000 -999 -998
997 1000 100...

output:

2824.538686539615527815
2824.538775138651718777
2822.773563878330575827
2823.830960199563514523
2817.125127034449595609
2817.481126365018560431
2827.013014369991310115
2815.001764892294902953
2816.052993143207157534
2821.005815341338242463
2819.598909726343093363
2818.885412080211017694
2822.7735638...

result:

ok 100000 numbers

Test #59:

score: 0
Accepted
time: 439ms
memory: 3792kb

input:

100000
985 -1000 1000 -884
-1000 969 -996 1000
987 -801 1000 -1000
-1000 1000 -997 954
-1000 999 -1000 1000
999 -1000 1000 -949
989 -1000 1000 -916
-1000 977 -997 1000
983 -894 1000 -1000
-996 975 -1000 1000
982 -1000 1000 -857
-999 1000 -1000 992
-1000 915 -999 1000
998 -1000 1000 -829
997 -891 100...

output:

2770.248700937522113419
2737.643553073989872271
2809.766956754385140549
2785.915071566330759589
2775.024779872123871671
2768.917167184398320234
2738.620298596933730462
2776.292356150151557026
2756.782212760112098948
2744.380988981948584549
2733.384462431116701975
2776.431940486502838228
2768.5113547...

result:

ok 100000 numbers

Test #60:

score: 0
Accepted
time: 448ms
memory: 3788kb

input:

100000
-1000 120 -997 1000
1000 -707 999 -1000
1000 -1000 993 -136
-1000 1000 -984 -975
-980 -471 -1000 1000
1000 -1000 991 -338
-1000 1000 -997 210
1000 -1000 999 -737
1000 -817 996 -1000
-1000 314 -985 1000
-1000 85 -986 1000
997 -1000 1000 -804
999 -978 1000 -1000
-988 737 -1000 1000
-1000 844 -9...

output:

2457.289651608728406007
2154.854368775651185075
2233.864306104745939052
2490.101958975000904672
2537.682122424428893925
2470.184352601410614270
2725.288741766270820932
2761.145218218790744480
2489.239230224458083951
2388.412225421216485532
2196.490934173324703904
2367.314007259168605612
2591.0221594...

result:

ok 100000 numbers

Test #61:

score: 0
Accepted
time: 457ms
memory: 3740kb

input:

100000
973 1000 1000 861
-1000 -964 -993 -1000
961 1000 1000 842
-1000 -923 -981 -1000
-967 -1000 -1000 -999
1000 996 869 1000
950 1000 1000 871
-1000 -951 -981 -1000
1000 989 806 1000
-1000 -997 -947 -1000
-980 -1000 -1000 -977
933 1000 1000 923
-967 -1000 -1000 -965
1000 913 918 1000
-993 -982 -10...

output:

2755.213289525374745326
2725.931648821519053261
2769.398619561565042746
2741.652367221037353229
2737.751680945352468655
2762.486828788748363106
2744.887968998204953008
2746.707101685659561330
2774.841647936980606470
2693.131086657914445182
2754.481624100675283939
2776.592205849988213240
2825.2455571...

result:

ok 100000 numbers

Test #62:

score: 0
Accepted
time: 461ms
memory: 3688kb

input:

100000
-906 -623 -1000 -1000
999 996 1000 1000
1000 643 978 1000
-899 -1000 -1000 639
1000 899 977 1000
-1000 -416 -867 -1000
-802 -1000 -1000 525
953 1000 1000 638
991 1000 1000 800
-941 -1000 -1000 311
1000 1000 910 447
-1000 -1000 -813 149
962 773 1000 1000
-811 129 -1000 -1000
-1000 171 -839 -10...

output:

2662.765883084892281740
2227.058270601669606403
2542.724107187863055390
2195.605144459133080126
2350.629329332730000246
2206.012224628102744717
2316.314891587426725739
2375.819903687659816249
2549.538346725641755341
2300.516309061862673779
2333.093880094489736665
2257.764311987069760335
2412.0740880...

result:

ok 100000 numbers

Test #63:

score: 0
Accepted
time: 484ms
memory: 3736kb

input:

100000
-965 1000 -1000 747
917 -1000 1000 -400
1000 111 864 -1000
-1000 469 -935 1000
1000 -1000 -982 43
-333 649 -1000 1000
1000 -1000 -981 -889
-1000 1000 -768 987
-247 812 -1000 1000
1000 -1000 -510 -623
-1000 368 -621 1000
239 -1000 1000 269
-343 816 -1000 1000
-996 -441 1000 -1000
-1000 1000 -8...

output:

2503.958795637901062925
2259.222791880335920345
1533.103766780191675623
2194.889302527019825151
1963.493261419197948414
1835.231062010298668352
1835.074353425764413061
1776.557884812778155270
2201.858704232635382425
1616.668776842118233406
1833.798802294532425350
2654.478452997753931131
2726.6919653...

result:

ok 100000 numbers

Test #64:

score: 0
Accepted
time: 553ms
memory: 3692kb

input:

100000
228 1000 602 -1000
-836 -1000 -610 1000
-447 1000 920 -1000
102 -1000 -230 1000
-647 1000 961 -1000
640 -1000 221 1000
742 1000 -518 -1000
999 1000 469 -1000
-60 1000 -814 -1000
-330 1000 -534 -1000
-473 1000 356 -1000
103 -1000 139 1000
-961 -1000 212 1000
656 -1000 -544 1000
436 1000 -434 -...

output:

1377.803296714320952510
838.659609666434338660
858.806795216049579433
1008.397063104401000067
708.539078002710315973
750.596237650730646274
953.734834420138924749
1065.273111637861105927
1112.265426218200686903
800.384636640409775299
851.906146453909112914
803.809294580071827807
1031.147674406607029...

result:

ok 100000 numbers

Test #65:

score: 0
Accepted
time: 713ms
memory: 3692kb

input:

100000
-537 1000 227 -1000
-1000 -347 1000 931
895 1000 -716 -1000
1000 712 -1000 154
-931 1000 568 -1000
-1000 854 1000 732
162 1000 -694 -1000
1000 -987 -1000 242
953 -1000 858 1000
1000 918 -1000 721
1000 -542 -1000 968
540 1000 -238 -1000
-1000 -46 1000 689
-75 1000 -615 -1000
1000 227 -1000 -62...

output:

902.347782847932339823
937.528923322304470811
1134.571576910824571183
942.527623685785926888
1363.435724705605579743
910.794485766507970148
868.449784076570477864
992.109299329086855579
916.398036329523871524
889.338401835682115459
903.119088137852397580
950.220917288795493716
818.142495411119977045...

result:

ok 100000 numbers

Test #66:

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

input:

7
-1000 -1000 1000 1000
-1000 -1000 1000 1000
-1000 -1000 1000 1000
-1000 -1000 1000 999
-1000 -1000 1000 1000
-999 -1000 1000 999
-1000 -1000 1000 1000
-1000 1000 1000 -1000
-1000 -1000 -1000 1000
1000 -1000 1000 1000
-1000 -1000 -1000 -999
1000 999 1000 1000
-999 -1000 -1000 -999
1000 999 999 1000

output:

942.809041582063365849
942.691764381827171093
942.574898913510841769
1082.150160093487008983
2153.271465790356018033
2827.720121119055683989
2827.012970138752990135

result:

ok 7 numbers

Test #67:

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

input:

1
-1000 -1000 1000 1000
-1000 1000 1000 -1000

output:

1082.150160093487008983

result:

ok found '1082.150160093', expected '1082.150160093', error '0.000000000'

Extra Test:

score: 0
Extra Test Passed