QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#233412#6620. Linear Fractional Transformationextreme1228#AC ✓263ms3780kbC++203.2kb2023-10-31 17:21:222023-10-31 17:21:22

Judging History

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

  • [2023-10-31 17:21:22]
  • 评测
  • 测评结果:AC
  • 用时:263ms
  • 内存:3780kb
  • [2023-10-31 17:21:22]
  • 提交

answer

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

typedef long long ll;

struct com{
    double x,y;  
    friend com operator +(const com&a,const com&b){
        com c;
        c.x = a.x + b.x;
        c.y = a.y + b.y;
        return c;
    }
    friend com operator -(const com&a,const com&b){
        com c;
        c.x = a.x - b.x;
        c.y = a.y - b.y;
        return c;
    }
    friend com operator *(const com&a,const com&b){
        com c;
        c.x = a.x*b.x - a.y*b.y;
        c.y = a.y*b.x + a.x*b.y;
        return c;
    }
    friend com operator /(const com&a,const com&b){
        com c;
        c.x = (a.x*b.x + a.y*b.y)/(b.x*b.x + b.y*b.y);
        c.y = (-a.x*b.y+a.y*b.x)/(b.x*b.x + b.y*b.y);
        return c;
    }
    
    friend bool operator ==(const com&a,const com&b){
        return fabs(a.x-b.x)<1e-9 && fabs(a.y-b.y)<1e-9; 
    }
    friend bool operator !=(const com&a,const com&b){
        return !(fabs(a.x-b.x)<1e-9 && fabs(a.y-b.y)<1e-9); 
    }
};



void solve()
{
    com z1,z2,z3,w1,w2,w3,z0,w0;
    cin>>z1.x>>z1.y>>w1.x>>w1.y;
    cin>>z2.x>>z2.y>>w2.x>>w2.y;
    cin>>z3.x>>z3.y>>w3.x>>w3.y;
    cin>>z0.x>>z0.y;

    com ze;ze.x = 0;ze.y=0;
    com a,b,c,d;

    //d=0 c!=0  ->  c=1  // (az+b)/z 此时不能有z为0


    if(z1!=ze && z2!=ze && z3!=ze && z0!=ze){
        a = (w1*z1 - w2*z2)/(z1-z2);
        b = w1*z1 - a*z1;

        if((a*z3 + b)/z3== w3){
            w0 = (a*z0+b)/z0;
            cout<<w0.x<< " "<<w0.y<<"\n";
            return;
        }

    }
  
    //d!=0 -> d=1
    d.x=1;d.y=0;
    
    //c=0
    a = (w1-w2)/(z1-z2);
    b = w1-a*z1;
    if((a*z3 + b) == w3){
        w0 = a*z0+b;
        cout<<w0.x<< " "<<w0.y<<"\n";
        return;
    }

    //c!=0


    //a=0
    // c = (w2 - w1)/(w1*z1 -w2*z2);
    // b = w1*(c*z1+d);

    // if( b/(c*z3+d) == w3){
    //     w0 = b/(c*z0 + d);
    //     cout<<w0.x<< " "<<w0.y<<"\n";
    //     return;
    // }
    



    //a!=0
    if( ((z1 -z2)*(w1*z1 - w3*z3) - (z1 - z3)*(w1*z1 - w2*z2)) != ze)
        a =((w3 - w1)*(w1*z1 - w2*z2) - (w2 - w1)*(w1*z1 - w3*z3) ) / ((z1 -z2)*(w1*z1 - w3*z3) - (z1 - z3)*(w1*z1 - w2*z2));
    else if( ((z2 -z3)*(w2*z2 - w1*z1) - (z2 - z1)*(w2*z2 - w3*z3)) != ze)
        a =((w1 - w2)*(w2*z2 - w3*z3) - (w3 - w2)*(w2*z2 - w1*z1) ) / ((z2 -z3)*(w2*z2 - w1*z1) - (z2 - z1)*(w2*z2 - w3*z3));
    else{
        a =((w2 - w3)*(w3*z3 - w1*z1) - (w1 - w3)*(w3*z3 - w2*z2) ) / ((z3 -z1)*(w3*z3 - w2*z2) - (z3 - z2)*(w3*z3 - w1*z1));
    }
    if(w1*z1 - w2*z2 != ze)
        c = (a*(z1-z2) + w2 - w1)/(w1*z1 - w2*z2);
    else if(w2*z2 - w3*z3 != ze)
        c = (a*(z2-z3) + w3 - w2)/(w2*z2 - w3*z3);
    else{
        c = (a*(z3-z1) + w1 - w3)/(w3*z3 - w1*z1);
    }

    
    b = w1*(c*z1+d)- a*z1;

    w0 = (a*z0 + b)/(c*z0 + d);
    cout<<w0.x<<" "<<w0.y<<"\n";

}




int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t = 1;
    cin>>t;

    cout<<fixed<<setprecision(15);

    while(t--){
        solve();
    }
    return 0;
}


/*

2
-1 0 0 -1
0 1 -1 0
1 0 0 1
0 -1
-1 0 -1 0
0 1 0 -1
1 0 1 0
0 -1


1
1 0 4 0
2 0 2 0
5 0 5 0
0 0


*/

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

详细

Test #1:

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

input:

2
-1 0 0 -1
0 1 -1 0
1 0 0 1
0 -1
-1 0 -1 0
0 1 0 -1
1 0 1 0
0 -1

output:

1.000000000000000 0.000000000000000
0.000000000000000 1.000000000000000

result:

ok 4 numbers

Test #2:

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

input:

100000
0 0 -1 1
1 1 1 0
1 0 1 -1
-1 0
-1 -1 -1 1
1 -1 1 -1
-1 0 1 0
-1 -1
-1 -1 0 -1
-1 1 -1 -1
0 -1 0 0
1 1
1 0 0 -1
0 0 0 0
-1 -1 1 0
1 1
-1 -1 0 -1
0 1 1 -1
1 0 -1 -1
1 -1
0 1 1 -1
1 0 1 0
0 -1 0 1
-1 -1
1 1 -1 1
0 0 -1 -1
0 1 0 1
1 0
1 1 1 -1
0 1 -1 -1
1 0 -1 0
1 -1
1 0 -1 1
-1 -1 1 0
0 -1 0 1
0...

output:

1.000000000000000 1.666666666666667
-1.000000000000000 1.000000000000000
-1.500000000000000 -0.500000000000000
0.333333333333333 -0.666666666666667
-0.384615384615385 -0.923076923076923
-1.000000000000000 0.000000000000000
-1.500000000000000 0.500000000000000
-0.853658536585366 -0.317073170731707
-1...

result:

ok 200000 numbers

Test #3:

score: 0
Accepted
time: 217ms
memory: 3584kb

input:

100000
2 -2 -1 -1
-1 2 2 -2
-1 -1 -2 2
2 0
-1 1 0 -2
2 -1 -2 1
2 -2 2 1
2 2
2 2 -2 -1
-2 1 2 1
1 1 -2 -2
1 -2
-2 -1 0 1
2 -1 1 1
1 0 -2 0
-1 0
1 2 -2 0
2 0 0 -1
-1 1 -2 -1
-1 2
1 0 0 -1
2 -1 -2 2
1 -2 -1 1
1 2
2 1 -2 -1
-2 2 0 -1
0 1 -1 1
1 -2
2 2 1 1
-1 1 2 2
-1 2 -1 -2
0 0
2 -1 -1 -2
1 -1 -2 1
0 1...

output:

-0.268727705112961 -0.982164090368609
-0.557315936626282 -2.690587138863001
-0.603550295857988 -1.248520710059172
-0.162162162162162 0.972972972972973
-2.230769230769230 -0.846153846153846
0.529411764705883 0.882352941176471
-2.000000000000000 -3.000000000000000
1.312373225152130 1.336713995943205
-...

result:

ok 200000 numbers

Test #4:

score: 0
Accepted
time: 218ms
memory: 3656kb

input:

100000
-2 -3 1 1
0 -3 3 3
-1 1 0 3
-1 -2
-3 1 -3 -1
0 -1 2 3
-2 0 -2 1
2 3
-2 1 3 -1
3 -1 3 -2
2 1 0 -3
-3 -1
-1 2 0 3
1 1 -3 -3
-1 -3 2 -3
2 1
0 -3 1 2
-3 -2 0 3
-2 2 2 -3
2 -3
-3 0 -3 2
0 0 -3 1
0 1 0 3
3 0
-3 -3 0 -3
1 1 3 -2
1 0 2 0
-1 1
-3 1 -3 2
-2 3 2 3
0 2 -2 -3
-1 -1
1 -2 1 1
1 1 -2 -3
-1 0...

output:

1.313513513513514 2.318918918918919
11.333333333333332 -22.333333333333329
3.041260744985673 -1.188538681948424
-1.411764705882353 -2.647058823529412
1.031596224866639 1.575297496922445
-3.666666666666667 2.000000000000000
1.333333333333333 -5.333333333333333
-4.333333333333333 0.000000000000000
5.0...

result:

ok 200000 numbers

Test #5:

score: 0
Accepted
time: 217ms
memory: 3628kb

input:

100000
-4 -1 -3 1
-3 -4 -2 -2
-1 2 -4 -4
-1 2
1 0 1 4
-3 0 4 -4
-1 -2 -3 -1
3 4
-2 3 2 3
-3 2 4 0
2 -3 -2 0
1 -4
1 1 1 -3
3 1 -4 1
2 -3 -1 4
3 4
3 -2 3 1
4 -3 1 2
3 -1 -2 0
2 0
-2 -4 3 -2
2 1 3 1
-1 1 -1 -1
-4 -2
2 4 0 -2
-1 -2 -1 -4
0 -1 1 -3
1 3
-2 -2 -4 1
4 3 0 2
-2 -1 0 4
0 2
-3 0 -3 -1
-1 1 -4 ...

output:

-4.000000000000000 -4.000000000000000
2.472399767576990 1.445090063916328
-1.850992300184362 -0.274590608393883
-8.808298488259892 4.633000964940496
-1.171974522292994 2.815286624203822
2.785714285714285 -2.857142857142857
0.052451539338655 -2.079817559863169
0.049797898140662 2.210347615198060
-3.4...

result:

ok 200000 numbers

Test #6:

score: 0
Accepted
time: 227ms
memory: 3660kb

input:

100000
2 -1 -3 4
3 5 1 -5
-1 -2 0 -4
5 1
-3 2 1 0
3 -3 2 -5
-4 -4 2 1
3 3
3 -3 2 -2
3 5 -2 5
2 -3 0 3
-2 -1
-4 2 1 1
-2 5 1 5
4 -3 2 5
-1 2
-4 4 -5 2
-3 -1 5 5
-5 3 4 -4
-1 0
5 -1 -1 -3
2 3 -3 -5
-4 -1 -5 2
5 2
-1 -4 -2 2
-5 5 -1 2
-3 4 -3 -1
-1 -1
1 -3 -1 -3
-5 -3 -4 0
-2 -1 -4 2
0 4
0 -4 -4 -2
-4 ...

output:

1.816354696799794 -4.945829379798153
0.946127071536184 -1.116473583043275
-1.542493677676451 4.473829412215495
1.577540106951872 4.401069518716577
4.030285035629454 5.621733966745843
-1.925716036146424 -3.670240465614949
-2.089336578797452 1.939406494380859
-6.391167192429023 -0.593059936908518
-4.0...

result:

ok 200000 numbers

Test #7:

score: 0
Accepted
time: 221ms
memory: 3656kb

input:

100000
-6 6 -2 4
-5 5 3 -6
-1 4 -6 -4
1 5
-4 -3 -4 5
6 -3 1 4
-3 5 4 3
-1 5
5 -2 -5 2
-2 3 5 5
2 2 -3 0
2 4
-1 -6 2 1
-6 -5 4 -4
-5 -6 3 3
1 5
-3 5 1 1
5 5 -4 0
-1 4 6 -3
2 -5
3 1 -2 -4
4 3 3 -3
-5 -6 2 -2
2 0
4 -4 5 -4
6 3 0 1
3 4 -2 -1
6 -4
-5 6 -6 -3
-3 2 3 3
5 -3 -5 -6
2 -2
-3 5 3 -5
0 3 4 3
1 -...

output:

-6.309906858594411 -3.307366638441999
3.365726447048949 3.642666586733011
-3.795572958803919 -2.487427591340088
1.750836742283377 0.544440312383786
-2.149610846786392 -0.907648304502076
0.872600876530149 -1.883633066344265
6.092863541355630 -2.229322185727082
-4.667996272222268 -6.481988904073504
-3...

result:

ok 200000 numbers

Test #8:

score: 0
Accepted
time: 218ms
memory: 3724kb

input:

100000
-2 -1 -3 0
4 -4 -2 6
2 -1 -7 0
0 -6
-1 0 1 -2
-2 -3 2 -5
3 -2 -1 5
6 -1
1 5 -6 7
-6 -3 -3 2
7 -2 -3 -3
-3 -4
1 7 -5 -2
-5 -4 -5 -4
2 0 1 6
7 4
1 -3 6 -7
-6 -6 1 -5
4 -2 1 1
-3 -3
-5 0 2 7
-2 2 -5 1
3 -4 -1 6
6 4
-7 4 3 -2
-5 4 7 -7
0 2 0 2
2 -3
-7 1 4 -6
0 5 2 -6
4 -2 4 -5
-2 3
1 -7 -1 -7
7 -...

output:

-2.131422579517650 2.030059419783292
-3.893870082342179 0.751143641354072
-2.398470467736429 1.637364288152954
-6.139589807333747 -1.605469235550032
1.866404715127702 -5.212180746561887
-1.801550096881054 6.410088130508157
0.592365006152383 0.964587941329670
3.248780487804878 -5.960975609756097
1.89...

result:

ok 200000 numbers

Test #9:

score: 0
Accepted
time: 222ms
memory: 3568kb

input:

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

output:

-0.120524504789361 3.034501999442016
-4.005907740781470 5.584209921722432
-8.429934825729671 -5.987339189572118
4.602292604860621 -0.542856079496818
3.464705882352940 -2.041176470588235
0.630072895864059 5.112222935734498
-5.269035532994924 2.233502538071067
-4.732206345883091 -6.242760088432851
-2....

result:

ok 200000 numbers

Test #10:

score: 0
Accepted
time: 219ms
memory: 3724kb

input:

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

output:

-0.940805671480208 5.363530007508424
-0.427089404359483 -3.365310642265999
6.205317609794532 -8.463662470503481
6.158889545186060 -2.382161842882458
-1.629582412764708 11.371923185638558
-9.705901508846834 3.353294496508305
9.209075412304827 10.567479946873593
-10.687899399260958 -2.079464937975647
...

result:

ok 200000 numbers

Test #11:

score: 0
Accepted
time: 243ms
memory: 3656kb

input:

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

output:

9.397932000529380 -4.725585826171160
-4.610935139613079 -0.753618244724916
1.813971728114412 -2.473520382840792
8.032270112795999 -10.880705161724066
0.668225860340795 -4.396926161042432
3.426765683682828 -9.996291488280900
2.386955394856971 1.932308899313282
9.105260114403610 -6.992107862299314
-4....

result:

ok 200000 numbers

Test #12:

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

input:

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

output:

-9.641562964814442 -7.839370782097037
-0.612303383188506 -0.743837944584709
8.611786774662409 -1.485645427779917
5.124889376347340 3.048886199462956
-7.682534316725499 -0.430414615663984
2.663172955347043 -7.116889598722301
-8.116446477322116 5.061364681657264
-8.475793144513323 1.651335909706500
-7...

result:

ok 200000 numbers

Test #13:

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

input:

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

output:

11.013882132318942 14.485141047044957
8.767393060502618 2.103428854021311
-1.186562201856082 7.644713637283531
-3.769230769230769 -0.153846153846153
-9.165900180385053 7.093457806118019
-4.583897363336409 6.685280204646167
-5.561061946902652 -7.184070796460174
2.539220333150449 -3.116357550750092
-4...

result:

ok 200000 numbers

Test #14:

score: 0
Accepted
time: 244ms
memory: 3580kb

input:

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

output:

-7.335360872263204 5.110779735004138
14.806845551651659 74.786644621100223
-8.949423614563191 9.235864818473486
-6.692056245187955 -6.843709336827269
9.666674782386181 1.097874000201675
12.910265370100438 15.659431720612606
16.645082083209992 -4.313471566756633
6.034002016235258 -7.816828187952466
-...

result:

ok 200000 numbers

Test #15:

score: 0
Accepted
time: 232ms
memory: 3764kb

input:

100000
-10 13 0 3
14 13 11 -3
7 4 -1 -8
-13 9
-7 1 -8 -8
-6 -12 -14 11
10 12 -13 -2
-8 14
7 6 6 -11
-12 -11 -9 4
-12 12 -12 1
10 -6
-14 4 -5 -14
14 -12 -3 11
2 11 -8 1
10 1
-4 -14 -4 -4
-6 -2 -4 14
0 -5 -6 -2
3 1
-4 12 -6 1
12 2 9 5
-13 -6 -14 4
-6 8
-2 2 -1 -10
14 -9 -5 0
4 -14 -3 -7
-8 -10
0 13 10...

output:

-1.187920126403672 3.455980441242451
-13.759338445771638 -4.633636074495531
-3.460191596576197 4.180226125178007
-4.726109241950947 5.799971742398811
-4.272163602741217 -0.904383770259980
-7.729518291730991 0.012055716491180
-1.527735808331536 -8.303475070148933
9.016926077561260 -7.526332082427603
...

result:

ok 200000 numbers

Test #16:

score: 0
Accepted
time: 245ms
memory: 3768kb

input:

100000
14 -14 -7 -15
-10 -2 -5 -5
-9 12 15 -12
-1 14
-8 -9 15 -9
-13 6 7 9
12 10 9 1
6 -11
-11 9 -6 2
-3 11 -8 3
10 -2 -8 -13
-11 -13
-9 -12 14 2
0 1 4 -3
5 10 14 3
5 7
11 -10 0 -11
6 4 11 -2
-1 -4 4 -12
6 -7
1 -3 -2 -7
12 -11 -6 8
15 -1 12 -1
-10 9
-10 -6 4 4
11 13 14 -11
-10 12 -10 11
-12 -7
14 6 ...

output:

4.428658017083086 -18.126991529864558
10.419613597657071 -2.047225359011509
-3.263708063302651 -0.665963760983810
13.834557705511870 3.176504677222856
0.811301724403020 -12.962033066717687
0.717283158579100 -3.843111792720180
3.435480587826356 3.521875979383774
-1.941967674393084 14.576659456810761
...

result:

ok 200000 numbers

Test #17:

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

input:

100000
9 5 -15 2
-2 -11 5 6
-13 -10 15 -1
-9 6
16 -7 -12 -4
13 -9 -12 -10
-16 -10 -11 13
16 -14
-15 -11 -2 -1
-14 2 -1 -2
-15 5 -7 6
10 3
-12 -6 -14 3
-16 1 9 13
-7 -6 -8 -3
-16 3
5 8 9 6
-15 10 -4 -14
7 -13 -3 -9
-8 11
11 -5 -8 -3
-8 15 -3 14
3 -8 10 11
4 -9
-7 11 -14 11
16 -7 11 -15
12 14 14 -7
2 ...

output:

-0.982729396993689 -15.501844941233914
-3.665198209446245 -3.780295645370165
-2.327865741585806 -1.047988419018978
11.302677934099334 7.154919523820489
-4.909148383624536 -16.273543705845928
9.008945415595132 8.258780161828064
4.069824243080181 -13.380125673970127
4.962757268353489 -9.51007486382508...

result:

ok 200000 numbers

Test #18:

score: 0
Accepted
time: 245ms
memory: 3584kb

input:

100000
1 12 -13 4
6 -2 -14 -2
14 -2 2 -9
-9 4
14 -16 7 16
16 -4 11 5
13 -16 -2 -16
-10 -6
14 -15 -17 -15
-11 17 -9 3
-4 -13 -1 1
4 -14
9 -11 -16 8
-2 -11 -10 9
-9 -13 13 12
1 17
17 13 10 13
14 -13 6 4
3 15 14 12
10 -13
2 -8 -5 -14
-5 9 9 2
1 -10 -3 -11
-2 8
7 -8 -1 -15
15 5 10 4
-14 4 6 6
-2 3
1 -12...

output:

-15.100627686363937 3.573868783521421
10.461274574399720 4.518654966341061
8.417568732172120 -6.270556533349522
-17.907437819840343 3.232653730572773
7.060698951215028 2.118412948733827
10.483340777768486 4.023308496799486
5.875137587829862 4.156460023168997
11.916747525713175 10.898311663108867
-14...

result:

ok 200000 numbers

Test #19:

score: 0
Accepted
time: 243ms
memory: 3580kb

input:

100000
15 6 5 12
-6 -6 -4 -12
-7 8 4 3
-11 -5
-1 10 -2 -2
3 -2 -4 14
-17 13 -12 -2
10 0
-6 -16 -13 -5
0 4 9 -13
11 16 -10 -8
-1 0
-9 13 -12 -4
12 -18 -7 8
-6 11 -8 -3
-16 0
11 5 15 10
14 -9 13 -18
-13 -14 5 -4
-15 13
8 -18 -17 16
-3 1 3 -11
11 17 14 15
0 11
15 -8 14 11
-8 12 -14 18
4 12 11 7
-16 3
-...

output:

-3.306203711571415 -2.915417578144142
-5.410263295057885 8.090313205818708
-13.036730499035398 6.643718810749588
0.967684186366779 29.467156300206547
4.315480536916849 0.255876378206925
14.430447072125201 2.669929264367082
16.574948329048581 18.616325530480140
-4.434330407355055 11.147879650013934
-...

result:

ok 200000 numbers

Test #20:

score: 0
Accepted
time: 234ms
memory: 3768kb

input:

100000
-11 -2 12 -10
-7 -13 2 -5
-15 -6 -14 -16
12 -2
3 1 6 -16
-1 -5 -14 -18
0 3 -7 -14
-7 17
16 17 -10 13
-3 18 -18 5
-15 1 -16 12
19 0
-15 -18 13 -9
-5 3 -14 9
-6 9 10 15
-4 14
10 -19 -9 14
-13 6 -12 -15
10 2 -6 7
16 -1
14 12 -15 11
-2 -17 11 0
18 16 -17 -13
-6 4
-16 -18 3 -5
15 -10 -12 -1
-18 -1...

output:

3.698873266633813 -7.693539574632902
-12.204848147116190 -12.098746168849260
-12.961117016212850 13.920704090937338
11.852502385753652 7.536280653890275
-7.696875014816534 8.509124615362737
6.798057260265247 1.432690948793565
-11.904624842061011 -2.037710575800431
-28.253314344701483 -5.533476698306...

result:

ok 200000 numbers

Test #21:

score: 0
Accepted
time: 251ms
memory: 3656kb

input:

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

output:

10.298825501680328 -6.952922897364448
-5.112847030805531 -2.082813292465103
14.185697712476241 -3.236903039165198
-9.068810513528893 -16.065232879380424
11.908925676601395 8.588148997736747
-15.219570227990243 9.760576541341102
-40.208795137647542 -89.096531998569944
4.726367949584155 -18.5697077584...

result:

ok 200000 numbers

Test #22:

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

input:

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

output:

-6.801053399419869 15.486678866159474
-3.122996686837025 31.510311175611026
3.700840757937007 -12.298657297025976
-25.847971094038410 -48.935200841315329
6.950077672670269 -23.066737987082739
-25.672683953174698 -9.197737253546737
-28.230749942239427 -2.758479843234706
13.595473783548611 -5.62950440...

result:

ok 200000 numbers

Test #23:

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

input:

100000
37 12 -7 8
-26 -32 -10 10
37 -35 -33 30
-8 -4
-16 -19 -35 30
40 37 -3 -17
-12 -15 -4 14
26 4
19 13 -3 38
33 -2 0 -40
19 31 12 -20
10 -10
17 -7 -34 -3
-25 34 -15 10
15 37 -38 38
14 7
-29 -7 -24 11
-26 19 -20 38
-19 -34 -6 6
34 36
-29 31 17 -38
-6 -32 -24 34
-31 -14 21 -8
9 -23
10 3 -33 14
-23 ...

output:

-9.545669186892944 8.839872212577557
-3.614552909013338 -14.289659252473303
15.694016888016572 -44.233300134257760
-39.805392938375334 -11.444156244685745
2.920865041379890 26.581086459710008
-47.884300342270031 -14.762837362170197
17.863090701467975 19.018154067504256
-22.055401621429276 13.3422839...

result:

ok 200000 numbers

Test #24:

score: 0
Accepted
time: 254ms
memory: 3624kb

input:

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

output:

-3.243656495392058 40.847811542657773
55.383126307051526 -15.538049477894312
-31.105236000791443 40.339336774793324
12.048814895714502 16.928562873934794
-4.955719349751135 7.709238579750806
29.263242849553038 10.149471026950398
-55.597351687969386 20.698805760007541
103.562192471448768 30.609863828...

result:

ok 200000 numbers

Test #25:

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

input:

100000
22 -47 -50 24
-39 -52 -47 -34
-30 -15 -22 -12
-46 26
-5 -60 -25 -32
-48 -29 -1 10
30 15 -12 -37
44 -19
-28 3 -17 42
-39 -21 -56 22
15 36 30 53
-49 40
-44 -43 13 18
-43 -48 49 -47
-14 -9 -59 -53
-10 24
-17 59 29 -50
-34 -27 9 -50
57 54 21 31
6 -37
-44 22 -37 -11
47 9 -44 -39
28 50 47 16
40 23
...

output:

-34.213243915127386 -5.782318918727528
-15.586300566944159 -36.799555685751272
-3.643892438844430 81.546712757839089
-52.471115655944324 -53.058948272068115
2.144939870984115 -50.464418851182167
-34.243961373404723 -50.809903562711909
-41.999125172493891 -47.000178286790145
-38.596391988097409 46.39...

result:

ok 200000 numbers

Test #26:

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

input:

100000
43 -29 -20 -44
27 -41 -50 52
42 24 -22 12
60 -42
15 60 25 -40
7 -67 44 65
59 59 -37 10
-59 46
-60 -13 -63 -67
16 -20 -68 -28
-58 39 -21 19
-38 -42
20 -45 -33 17
60 -36 62 -67
-11 -63 -12 -17
-24 55
14 38 -5 -15
61 34 -45 36
5 -54 -66 50
1 7
59 15 42 -56
-47 4 13 56
54 -38 62 -41
-27 -3
15 -28...

output:

8.032415711200475 14.368698463754448
111.963039643918322 29.391042314113353
-65.721992975543571 -42.751284027298119
-11.272521973775643 -43.569258358547771
-78.248673989848569 88.793879000700315
65.627423003835020 144.607760793340759
13.686428554910760 -47.286812197210374
-95.714544565924569 -25.823...

result:

ok 200000 numbers

Test #27:

score: 0
Accepted
time: 257ms
memory: 3628kb

input:

100000
-62 -2 80 21
8 -52 -41 -9
-23 18 59 -36
80 64
45 65 -5 -60
-34 -15 -60 -22
9 -10 42 53
5 71
59 7 11 37
-58 12 35 -15
-45 -63 58 -80
62 -27
36 65 61 -38
73 -64 13 79
-9 -24 -71 -30
59 52
59 -16 -29 -75
-17 21 32 60
-51 36 22 -69
66 -63
56 -75 -75 70
-34 -13 -55 8
-11 -24 -70 5
-19 -73
22 -47 5...

output:

20.142486020347835 -154.515075377659372
-16.367894905259984 -67.406210150792816
-0.039588386212023 58.964189431953045
81.959084471820844 -24.795654092083360
-23.817256614690262 -80.228643100716297
-65.553151009581825 31.215000980938402
-35.054591060788667 -14.901894630223360
76.942603157575022 39.18...

result:

ok 200000 numbers

Test #28:

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

input:

100000
-88 -48 -22 59
-77 74 -11 44
-88 -47 -90 -14
81 -79
57 23 -90 -55
18 61 -34 54
76 68 -37 33
-82 11
-5 37 -27 -86
-71 -53 74 15
-21 47 74 -83
-46 12
-30 -58 6 2
-28 2 -33 7
-22 -80 -84 -61
6 24
-19 -69 -87 34
54 82 66 48
-39 -63 -41 -29
-25 -89
47 47 16 21
88 -39 41 -24
86 -31 -69 -15
-67 47
-...

output:

-10.991303613658872 44.190782397485705
-17.671897290805248 47.960183681132584
64.304569876151433 -11.274234066357625
-37.320488021329481 7.507647256797973
-32.948478335070753 34.350073897316079
18.390285914422158 20.187385050114496
13.433640327286959 -87.900207053963257
61.297741791206882 -58.123133...

result:

ok 200000 numbers

Test #29:

score: 0
Accepted
time: 263ms
memory: 3568kb

input:

100000
53 7 91 -58
86 -8 -4 -97
4 45 -61 82
-84 57
87 -48 -23 92
98 27 19 18
-51 -65 -76 -61
-64 -43
-42 42 -29 -59
-82 29 94 68
90 -79 22 -82
-54 -8
69 -61 -7 -64
25 26 -17 -18
35 48 15 -36
41 91
-85 7 -29 27
95 6 32 -85
88 44 75 -83
67 55
81 27 5 -26
2 -9 67 71
-12 88 -47 35
45 -95
8 45 15 -20
57 ...

output:

-69.749776228709933 10.295118161066625
-59.246613926465578 -64.094758211399608
19.046431433378235 -138.394730436183522
17.108908245913881 -57.883258098151877
89.560382721405333 -52.902563182514299
23.049497386362475 22.109587389299907
23.242666660762016 -23.875987345621159
15.934524220496980 31.5133...

result:

ok 200000 numbers