QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#299276#7903. Computational Intelligenceucup-team087AC ✓1321ms4120kbC++147.9kb2024-01-06 18:19:222024-01-06 18:19:24

Judging History

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

  • [2024-01-06 18:19:24]
  • 评测
  • 测评结果:AC
  • 用时:1321ms
  • 内存:4120kb
  • [2024-01-06 18:19:22]
  • 提交

answer

#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

using Int = long long;

template <class T1, class T2> ostream &operator<<(ostream &os, const pair<T1, T2> &a) { return os << "(" << a.first << ", " << a.second << ")"; };
template <class T> ostream &operator<<(ostream &os, const vector<T> &as) { const int sz = as.size(); os << "["; for (int i = 0; i < sz; ++i) { if (i >= 256) { os << ", ..."; break; } if (i > 0) { os << ", "; } os << as[i]; } return os << "]"; }
template <class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cerr << *i << " "; cerr << endl; }
template <class T> bool chmin(T &t, const T &f) { if (t > f) { t = f; return true; } return false; }
template <class T> bool chmax(T &t, const T &f) { if (t < f) { t = f; return true; } return false; }
#define COLOR(s) ("\x1b[" s "m")


using Double = double;
constexpr Double EPS = 1e-11;

inline int sig(Double r) { return (r < -EPS) ? -1 : (r > +EPS) ? +1 : 0; }
inline Double sq(Double r) { return r * r; }

struct Pt {
  Double x, y;
  Pt() {}
  Pt(Double x_, Double y_) : x(x_), y(y_) {}
  Pt operator+(const Pt &a) const { return Pt(x + a.x, y + a.y); }
  Pt operator-(const Pt &a) const { return Pt(x - a.x, y - a.y); }
  Pt operator*(const Pt &a) const { return Pt(x * a.x - y * a.y, x * a.y + y * a.x); }
  Pt operator/(const Pt &a) const { const Double d2 = a.abs2(); return Pt((x * a.x + y * a.y) / d2, (y * a.x - x * a.y) / d2); }
  Pt operator+() const { return Pt(+x, +y); }
  Pt operator-() const { return Pt(-x, -y); }
  Pt operator*(const Double &k) const { return Pt(x * k, y * k); }
  Pt operator/(const Double &k) const { return Pt(x / k, y / k); }
  friend Pt operator*(const Double &k, const Pt &a) { return Pt(k * a.x, k * a.y); }
  Pt &operator+=(const Pt &a) { x += a.x; y += a.y; return *this; }
  Pt &operator-=(const Pt &a) { x -= a.x; y -= a.y; return *this; }
  Pt &operator*=(const Pt &a) { return *this = *this * a; }
  Pt &operator/=(const Pt &a) { return *this = *this / a; }
  Pt &operator*=(const Double &k) { x *= k; y *= k; return *this; }
  Pt &operator/=(const Double &k) { x /= k; y /= k; return *this; }
  Double abs() const { return sqrt(x * x + y * y); }
  Double abs2() const { return x * x + y * y; }
  Double arg() const { return atan2(y, x); }
  Double dot(const Pt &a) const { return x * a.x + y * a.y; }
  Double det(const Pt &a) const { return x * a.y - y * a.x; }
  friend ostream &operator<<(ostream &os, const Pt &a) { os << "(" << a.x << ", " << a.y << ")"; return os; }
};
inline Double tri(const Pt &a, const Pt &b, const Pt &c) { return (b - a).det(c - a); }


int iSP(const Pt &a, const Pt &b, const Pt &c) {
	int s = sig((b - a).det(c - a));
	if (s != 0) return s;
	if (sig((b - a).dot(c - a)) < 0) return -2; // c-a-b
	if (sig((a - b).dot(c - b)) < 0) return +2; //   a-b-c
	return 0;
}
int iLL(const Pt &a, const Pt &b, const Pt &c, const Pt &d) {
	if (sig((b - a).det(d - c))) return 1;	//	intersect
	if (sig((b - a).det(c - a))) return 0;	//	parallel
	return -1;	//	correspond
}

Pt pLL(const Pt &a, const Pt &b, const Pt &c, const Pt &d) {
  const Pt ab = b - a, cd = d - c;
  return a + ab * (c - a).det(cd) / ab.det(cd);
}
Double pLL2(const Pt &a, const Pt &b, const Pt &c, const Pt &d) {
  const Pt ab = b - a, cd = d - c;
  return (c - a).det(cd) / ab.det(cd);
}


constexpr int N = 300;
constexpr int M = 10;

int main() {
  for (int numCases; ~scanf("%d", &numCases); ) { for (int caseId = 1; caseId <= numCases; ++caseId) {
    Double X[4][2];
    for (int i = 0; i < 4; ++i) for (int j = 0; j < 2; ++j) {
      int x;
      scanf("%d", &x);
      X[i][j] = x;
    }
    
    // kouten
    Pt P[4];
    for (int i = 0; i < 4; ++i) P[i] = Pt(X[i][0], X[i][1]);
    
    if ((P[1] - P[0]).abs2() > (P[3] - P[2]).abs2()) {
      for (int j = 0; j < 2; ++j) swap(X[0][j], X[2][j]);
      for (int j = 0; j < 2; ++j) swap(X[1][j], X[3][j]);
      swap(P[0], P[2]);
      swap(P[1], P[3]);
    }
    
    int I0 = -1;
    if (iLL(P[0], P[1], P[2], P[3]) == 1) {
      const Double s = pLL2(
        Pt(X[0][0], X[0][1]),
        Pt(X[1][0], X[1][1]),
        Pt(X[2][0], X[2][1]),
        Pt(X[3][0], X[3][1])
      );
      if (0 <= s && s <= 1) {
        I0 = min(max((int)(s * N), 0), N - 1);
// printf("kouten s = %f, I0 = %d\n",s,I0);
      }
    }
    
    for (int j = 0; j < 2; ++j) X[1][j] -= X[0][j];
    for (int j = 0; j < 2; ++j) X[3][j] -= X[2][j];
    
    
    Double a = 0.0;
    for (int j = 0; j < 2; ++j) {
      a += X[3][j]*X[3][j];
    }
    const Double sa = sqrt(a);
    auto calc = [&](Double s) -> Double {
      Double /*a = 0.0, */b = 0.0, c = 0.0;
      for (int j = 0; j < 2; ++j) {
        // ((X[2][j] + X[3][j] t) - (X[0][j] + X[1][j] s))^2
        const Double f = X[3][j];
        const Double g = X[2][j] - (X[0][j] + X[1][j] * s);
        // a += f*f;
        b += 2*f*g;
        c += g*g;
      }
      const Double l = b / (2*a);
      const Double r = l + 1;
      // const Double sa = sqrt(a);
      const Double d = (c - b*b / (4*a)) / a;
      if (d <= 0) {
        if (0 <= l) {
          return sa/2 * (r*r - l*l);
        } else if (r <= 0) {
          return sa/2 * (l*l - r*r);
        } else {
          return sa/2 * (l*l + r*r);
        }
      //*
      } else if (d <= EPS) {
        if (0 < l) {
          return sa/2 * ((r*r - l*l) + d/2 * log(max(r, +EPS) / max(l, +EPS)));
        } else if (r < 0) {
          return sa/2 * ((l*l - r*r) + d/2 * log(min(l, -EPS) / min(r, -EPS)));
        } else {
          return sa/2 * ((l*l + r*r) + d/2 * log(-min(l, -EPS) * max(r, +EPS) / (EPS*EPS)));
        }
      //*/
      } else {
        // auto sub = [&](Double u) -> Double {
          // const Double su = sqrt(u*u + d);
          // return sa * (u * su - d * log(su - u)) / 2;
        // };
        // return sub(r) - sub(l);
        const Double sl = sqrt(l*l + d);
        const Double sr = sqrt(r*r + d);
        // return sa/2 * ((r*sr - l*sl) - d * log((sr - r) / (sl - l)));
        // return sa/2 * ((r*sr - l*sl) - d * log((sl + l) / (sr + r)));
        return sa/2 * ((r*sr - l*sl) - d * log(max(sr - r, EPS) / max(sl - l, EPS)));
      }
    };
    
    // [l/N, r/N]
    auto easy = [&](int l, int r) -> Double {
      if (l == r) return 0.0;
      Double ret = 0.0;
      for (int i = 2*l; i <= 2*r; ++i) {
        const int coef = (i == 2*l || i == 2*r) ? 1 : (i % 2 == 0) ? 2 : 4;
        const Double res = calc(1.0 / (2*N) * i);
        ret += coef * res;
      }
      ret *= (1.0 / (2*N));
      ret /= 3.0;
      return ret;
    };
    auto hard = [&](int l, int r) -> Double {
      if (l == r) return 0.0;
      const Double sL = 1.0 / N * l;
      const Double sR = 1.0 / N * r;
      Double ret = 0.0;
      for (int j = 0; j <= 2*M; ++j) {
        const int coef = (j == 0 || j == 2*M) ? 1 : (j % 2 == 0) ? 2 : 4;
        const Double res = calc(sL + (sR - sL) / (2*M) * j);
        ret += coef * res;
      }
      ret *= ((sR - sL) / (2*M));
      ret /= 3.0;
      return ret;
    };
    
    Double ans = 0.0;
    if (~I0) {
    // if(0){
      int l = I0 - 1, r = I0 + 2;
      chmax(l, 0);
      chmin(r, N);
// cerr<<"l = "<<l<<", r = "<<r<<endl;
      ans += easy(0, l);
      ans += hard(l, r);
      ans += easy(r, N);
    } else {
      ans += easy(0, N);
    }
// cerr<<"easy(0,N) = "<<easy(0,N)<<endl;
// cerr<<"hard(0,N) = "<<hard(0,N)<<endl;
    printf("%.12f\n", (double)ans);
  }
#ifndef LOCAL
  break;
#endif
  }
  return 0;
}

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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.333333333333
0.765195716471
1.076635732895

result:

ok 3 numbers

Test #2:

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

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.777777777778
0.777777777778
1521.070405024590

result:

ok 3 numbers

Test #3:

score: 0
Accepted
time: 1265ms
memory: 4112kb

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.028267617368
5.744131448900
14.594278702892
2.952178245556
4.993502694129
6.058717255620
7.459408700251
11.228028907920
16.325707847495
11.072245157190
9.504557451155
5.500000000000
9.040049985829
5.326347910887
3.035934371290
5.808804183125
17.363719789522
9.995194519237
6.993302622881
6.55043322...

result:

ok 100000 numbers

Test #4:

score: 0
Accepted
time: 1300ms
memory: 3944kb

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.516226342418
7.895152181059
7.619252804124
6.272101354111
10.676587784428
4.048146349224
13.704168816530
5.960724885269
4.752273723777
5.808486858346
6.049334617409
4.212001303540
5.231052190723
7.816888558920
4.839493440447
6.085980058690
8.540849032643
6.899466200901
5.198575702571
7.92716381072...

result:

ok 100000 numbers

Test #5:

score: 0
Accepted
time: 800ms
memory: 3944kb

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.533823502912
7.905694150421
3.399346342395
0.942809041582
8.062257748299
9.848857801796
6.500000000000
6.699917080747
4.533823502912
5.830951894845
6.016087653749
5.467073155619
5.676462121975
3.800584750330
5.517648452416
3.887301263230
2.603416558636
4.333333333333
2.867441755681
3.518518518519
...

result:

ok 100000 numbers

Test #6:

score: 0
Accepted
time: 801ms
memory: 3892kb

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.523809523810
4.013864859597
7.500000000000
5.507010122909
2.748737083745
2.687419249433
3.901566636907
2.108185106779
4.333333333333
2.357022603955
4.176654695381
5.059644256269
3.484848484848
3.144660377352
4.027681991198
7.923222137911
2.357022603955
5.734883511362
2.981423970000
3.887301263230
...

result:

ok 100000 numbers

Test #7:

score: 0
Accepted
time: 1272ms
memory: 4056kb

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.044841559803
8.806908441629
7.211988492479
9.705894454248
5.879889741469
11.751734336573
7.387327468459
7.552508251824
4.795900553996
4.585511110002
11.636587321970
6.539467273582
8.155918942809
6.932750626219
3.744379817454
11.401172906234
16.839940311399
14.410838201436
6.386042190398
10.8509848...

result:

ok 100000 numbers

Test #8:

score: 0
Accepted
time: 1273ms
memory: 4004kb

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.797092276545
12.429172495132
8.976426143538
7.486123031633
7.130299838227
6.028769291792
4.087930934617
4.823038522433
6.123128729391
7.246635688920
7.724226961177
10.316193728710
5.124308856571
4.791595303088
3.302047238928
2.312246344814
8.410214920633
13.517584456800
8.533966057098
8.5450889120...

result:

ok 100000 numbers

Test #9:

score: 0
Accepted
time: 790ms
memory: 4052kb

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.011098792791
6.749485577106
4.346134936802
4.333333333333
5.270462766947
3.282952600599
3.726779962500
2.687419249433
1.943650631615
5.099019513593
2.108185106779
5.217491947500
5.587684871413
6.839428176228
1.699673171198
6.324555320337
3.431876713662
2.828427124746
5.666666666667
4.921607686744
...

result:

ok 100000 numbers

Test #10:

score: 0
Accepted
time: 1276ms
memory: 4052kb

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.596705004737
83.979645362573
49.327207070996
83.974820099519
163.879147592891
128.662991662278
86.719766613034
72.434035081333
120.317190035193
65.378944998095
38.467358046173
142.394344968573
172.484435283356
88.797397645167
103.861006339023
112.660658340547
53.222933956544
53.750870341578
119.3...

result:

ok 100000 numbers

Test #11:

score: 0
Accepted
time: 1305ms
memory: 3880kb

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.366697243199
69.863330974219
43.490764400896
87.084290278570
26.087927019385
68.005214731358
83.472363923873
69.433387650769
86.012446756088
63.715166111919
33.878784640395
62.029070851087
66.298085751867
34.852023277596
40.565384049318
68.634388327708
69.446066473601
85.792227570907
88.739697776...

result:

ok 100000 numbers

Test #12:

score: 0
Accepted
time: 879ms
memory: 4084kb

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.702968472635
104.651803615609
45.538750287835
33.666666666667
49.532454535260
46.130471579676
56.200039541307
35.267233769858
42.187412551350
56.372767263005
25.725041842100
25.510346484863
40.706264874095
35.377429245212
59.702968472635
39.491208585653
29.340908112887
51.066745539539
60.08327554...

result:

ok 100000 numbers

Test #13:

score: 0
Accepted
time: 866ms
memory: 3760kb

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.264004439645
36.831447915546
39.317793540443
40.787536256246
73.355299740373
46.019319614460
46.933759467762
57.950975449560
76.321687612369
50.064464615972
28.301943396170
32.743107841363
38.042374035044
40.311288741493
38.315938082097
66.049224068115
54.116130271441
42.038342286801
62.770304373...

result:

ok 100000 numbers

Test #14:

score: 0
Accepted
time: 1293ms
memory: 3960kb

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.422687496635
50.644821221567
69.955105650838
65.811674713837
37.060285155963
46.813610979707
45.083939963339
74.735619795524
61.806243114659
136.507674639486
122.814089323194
92.257707076590
63.249310241077
163.589101250705
90.477077823374
124.397353658420
39.994842256147
86.476683977190
66.9079...

result:

ok 100000 numbers

Test #15:

score: 0
Accepted
time: 1294ms
memory: 3924kb

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.467415419405
72.540916222264
55.550961539829
75.739380142008
83.071435678435
39.777700256266
101.947714522290
77.083991374082
94.066474164849
82.129527057189
82.889437065930
57.732847783009
63.883992880739
58.635820610973
103.974451216861
60.056323798186
24.086589316433
118.900466702855
41.307194...

result:

ok 100000 numbers

Test #16:

score: 0
Accepted
time: 860ms
memory: 3876kb

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.454147380889
36.392917503883
53.402039078838
27.294688127912
14.761059883656
18.811934746030
3.800584750330
55.547777233257
25.090945688745
22.932267417089
38.054055120461
16.606558276108
19.846634195472
50.982567826878
26.308004696501
51.808407726074
30.112751082852
42.064764880413
57.2712842531...

result:

ok 100000 numbers

Test #17:

score: 0
Accepted
time: 1284ms
memory: 4004kb

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.388887977431
986.154539459444
675.175454690697
731.446775039608
271.783669719026
994.707291771488
1599.696102060803
655.579132413343
1290.257232189615
500.634041959773
1131.040173433258
1252.726588287110
736.804586666694
508.487554587867
909.408751371929
898.404205633219
693.489680345789
1108.4...

result:

ok 100000 numbers

Test #18:

score: 0
Accepted
time: 1309ms
memory: 3948kb

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.587570591424
601.720709776588
631.819135732014
543.747869277218
1141.297157298984
897.087116437196
850.446807576030
993.820852795352
668.224532618240
237.791893931565
317.797310510424
248.830054766251
843.116541423362
454.656890013206
710.145619876649
742.534057362877
564.876910405604
998.895002...

result:

ok 100000 numbers

Test #19:

score: 0
Accepted
time: 876ms
memory: 3960kb

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.676401270708
741.084574945548
411.028520232410
385.836177095352
560.438419652171
388.545435638557
412.043687004181
468.406073829108
327.268153727863
487.844806834669
773.056918991092
156.553150363986
264.639167337129
649.914951700947
555.641171180747
389.341007027370
221.932171820331
759.9761876...

result:

ok 100000 numbers

Test #20:

score: 0
Accepted
time: 880ms
memory: 3940kb

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.442771207126
53.763435013441
173.365381652611
900.975582355038
280.643902481419
471.218397113035
848.644212847763
474.746482053550
402.161106467987
666.687499674490
217.988711003575
357.430956813885
514.075329542709
216.241120562724
222.044039675816
410.785291308679
609.800172187578
445.04032276...

result:

ok 100000 numbers

Test #21:

score: 0
Accepted
time: 1292ms
memory: 3856kb

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.208276677527
1056.720401249611
311.654867967646
714.636567896170
1164.816309948235
1274.091439263623
891.565373048441
570.655759763330
966.174623563179
1218.861856748168
537.988061237963
1086.364472653035
1227.393445747844
647.338865893999
398.215846520340
615.482980311070
662.026586745361
621.6...

result:

ok 100000 numbers

Test #22:

score: 0
Accepted
time: 1301ms
memory: 4008kb

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.692625540744
668.264226748430
707.760535007335
478.444111982725
502.737922490995
194.597806683921
1483.235394330066
1131.249465590582
1485.945304173072
607.103926633525
645.865525222820
737.668438255412
830.467019786492
588.635942592849
480.155175326047
666.055126988188
723.149201890374
562.8817...

result:

ok 100000 numbers

Test #23:

score: 0
Accepted
time: 867ms
memory: 3952kb

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.835498340075
661.964836259786
677.119799018034
458.883306395961
254.170764994281
443.034485740733
427.254933005785
620.952136283913
294.960637675229
229.987922388208
403.068783763324
181.502372191416
329.795391113945
51.009802979427
325.949041688694
431.532669034970
289.913780286485
318.47989645...

result:

ok 100000 numbers

Test #24:

score: 0
Accepted
time: 1236ms
memory: 3928kb

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.055206262731
642.627255905014
417.543749320377
887.043338534065
1033.963798175748
1083.247249385787
1159.656271438413
1462.684034005067
1079.078619316886
1280.991929078531
376.522465022627
1844.758684940352
650.380757818414
1337.527806517443
598.672367233350
1067.942354207292
1086.287864967546
...

result:

ok 100000 numbers

Test #25:

score: 0
Accepted
time: 1246ms
memory: 3860kb

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.327819608883
89.664930892756
438.610662549273
294.039562955966
726.646869193346
1066.960827747157
1491.524344522350
874.495482233950
806.061596839180
355.627132806736
1016.715075516236
1133.719572006712
1395.029276062254
1085.927489251558
842.229759374946
1234.808942726765
1826.020275383472
113...

result:

ok 100000 numbers

Test #26:

score: 0
Accepted
time: 1279ms
memory: 3992kb

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.228978105589
1059.003861962644
1481.129275393589
1110.862188749131
1076.448877478023
1442.118782777037
939.294718171287
1219.511809833437
1281.365579249667
620.155741031846
985.291025898865
745.874942198440
1019.803799995588
345.074869313855
1199.570246064474
1075.480714903241
883.426648901684
...

result:

ok 100000 numbers

Test #27:

score: 0
Accepted
time: 1296ms
memory: 3940kb

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.624125030526
866.367986251311
969.871725504807
533.148428974749
1532.609584915465
822.844217416614
1452.875212585089
1326.826208587982
740.521997636283
833.741732675171
1200.738293976589
961.075121009572
1028.980058346832
794.077305216382
530.437904036847
763.050504631321
848.339948859096
773.51...

result:

ok 100000 numbers

Test #28:

score: 0
Accepted
time: 1242ms
memory: 3996kb

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.673810471116
1425.083974133936
1549.075315578083
545.297472333791
229.683115040433
984.415731961524
1215.348646822545
1929.838421561085
890.056365256366
1527.409680908609
682.440717816216
1575.633629157916
241.373845587724
1183.697737318682
212.250638007106
1475.244160582704
764.068932317873
86...

result:

ok 100000 numbers

Test #29:

score: 0
Accepted
time: 1250ms
memory: 4056kb

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.082082348583
1692.128047356225
799.389660667019
752.374172957147
434.250648435274
825.568179950593
1391.966914789646
1007.707363027530
692.449716341230
2011.878589857435
1546.166997023862
1072.783939825043
1535.843993622118
1741.921947021091
1943.882128426473
1344.741506926871
786.810936038030
1...

result:

ok 100000 numbers

Test #30:

score: 0
Accepted
time: 1284ms
memory: 4004kb

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.760510333913
855.825038673963
178.115376566587
1619.151035341417
1095.760172926255
1987.499581101599
927.310582104293
967.473850235679
1306.482567081909
814.247625934594
1407.220066011962
779.377072642718
954.145522778462
662.209039717792
798.624420519603
952.897171629110
606.886986718878
573.9...

result:

ok 100000 numbers

Test #31:

score: 0
Accepted
time: 1274ms
memory: 3988kb

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.350054144636
1041.544738384720
1215.504188566769
668.942839880682
818.345050504472
835.242068061042
862.669742322686
1219.582807086225
1021.598350772997
592.817878248619
970.977291724186
645.147160878495
1484.872966239413
1499.728031268412
987.139699997442
1712.115172808196
1192.115484827052
649...

result:

ok 100000 numbers

Test #32:

score: 0
Accepted
time: 1233ms
memory: 4120kb

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.813590647043
950.849795868085
1124.318163767407
1721.925472716466
812.997745428399
1010.024422578305
1075.627413829676
1036.975570604332
2360.498534917645
1353.160128668591
979.417344119853
1329.069724797730
632.422590913175
329.542624601389
1359.930635656052
638.745125439607
697.837612698547
10...

result:

ok 100000 numbers

Test #33:

score: 0
Accepted
time: 1285ms
memory: 3892kb

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.734242093175
1512.868357635559
1106.707510317250
1004.727340749605
1448.835414708065
82.264078490165
1476.620919064841
1130.317817675096
1273.980128639458
886.029149822845
913.982470165372
968.046292754519
1176.439751169792
1276.155184522748
925.087549038022
1114.457005149678
782.290183188420
8...

result:

ok 100000 numbers

Test #34:

score: 0
Accepted
time: 1265ms
memory: 3948kb

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.037034638501
680.281035869351
913.320351118372
945.764002180159
1067.512077777219
630.583551664362
1208.114227411676
1135.904082433193
1213.196464618121
731.926505849868
1432.290376523549
1357.928734810589
939.387544447188
1599.508235047070
864.821726882025
800.848403082478
753.505913642524
1085...

result:

ok 100000 numbers

Test #35:

score: 0
Accepted
time: 1276ms
memory: 3996kb

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.817297884707
379.927000483985
1746.949952771794
228.505484559962
1337.771141337922
749.162665744492
977.445307596499
726.148265366827
555.412550795578
480.858627355747
873.539323447610
1093.314580040032
1217.379888523915
1287.466699811018
904.790510898890
2012.908366725707
1667.983609288611
454...

result:

ok 100000 numbers

Test #36:

score: 0
Accepted
time: 1268ms
memory: 4016kb

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.372991323115
878.740469671617
725.335783024035
697.212296334952
975.759483554773
967.467252248649
817.116507518558
1000.446906012575
554.619956548346
905.523214448852
634.059712297157
662.587726797099
940.988468517406
693.891900875891
1461.170864271201
641.055365082261
949.522062472998
534.97688...

result:

ok 100000 numbers

Test #37:

score: 0
Accepted
time: 1319ms
memory: 3884kb

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.489730345052
897.987853806865
1418.646011676413
1150.514777847175
1081.809528220911
1066.092167614381
1344.503302176587
1065.978493918454
1141.905762104695
1107.059863010625
1059.286039529810
1186.830705771153
884.840166257314
1241.863299023695
1150.356238881996
964.007053690326
835.760130286305...

result:

ok 100000 numbers

Test #38:

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

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.577642613440
863.079687389947
1648.445606220213
1160.947522440753
1803.917172895320
1125.636227502799
1647.332711438778
1399.010842815621
1089.201136265141
1220.780556310870
528.309569335600
547.271944939041
347.555631040189
1450.152721842323
619.348628928572
701.206341481246
1165.369004507468
4...

result:

ok 100000 numbers

Test #39:

score: 0
Accepted
time: 1226ms
memory: 3860kb

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.849389417669
1845.545136554729
440.368765320239
1324.559895486345
1334.032605378171
990.215928105336
1178.634541741848
289.974424765836
503.285875239619
1291.718848440086
1431.553555890128
647.732327870091
1052.778189831140
997.677260784639
2118.037043271224
1655.072769586558
1422.540626556709
8...

result:

ok 100000 numbers

Test #40:

score: 0
Accepted
time: 1270ms
memory: 4112kb

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.880961046077
257.845188657210
688.284209161775
701.562066646188
1369.239577659913
1279.872697215199
1527.929979140815
630.167386775684
401.716373486694
728.480744785159
519.825049388961
1531.225946016455
1241.196862815848
1131.257783527058
554.598025536150
805.280101221610
634.848284068853
880....

result:

ok 100000 numbers

Test #41:

score: 0
Accepted
time: 1293ms
memory: 3928kb

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.386641172305
952.787966833168
853.879811864016
644.960743832974
965.481696560569
739.693166787538
839.425663636386
941.417022089948
670.531614422538
519.569267227304
987.687625820145
954.936945566627
772.162011385477
1001.192776171238
1225.757987737491
956.701197943233
478.463433402188
716.11510...

result:

ok 100000 numbers

Test #42:

score: 0
Accepted
time: 1242ms
memory: 4000kb

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.577369573585
995.215688765778
187.962775935997
1160.947589395955
1803.917218792614
998.664494092323
1647.332593664945
675.080921606287
1089.200893182325
1220.780509792790
528.309622578014
918.994867526176
957.449596283006
843.595429945772
619.349043366297
110.788882504591
707.649667697250
636.45...

result:

ok 100000 numbers

Test #43:

score: 0
Accepted
time: 1239ms
memory: 3996kb

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.610133233829
853.413558746815
440.331842600628
868.218832439233
283.921937713501
2583.938469312615
822.236381030202
663.699855296420
198.808734693293
1276.233746373292
514.590973642146
1160.784557616292
416.851310435410
1020.465111087680
2099.592875552466
661.446640401052
338.965931282298
1564.3...

result:

ok 100000 numbers

Test #44:

score: 0
Accepted
time: 1270ms
memory: 4004kb

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.272768298378
789.987753428017
304.697067157617
1341.355283850667
138.597623701728
1739.748811540416
1338.299718509983
588.188128470526
604.198072200114
1314.849430606607
864.451629923290
1385.450263061242
1121.566525378515
803.234100471001
1195.465747105928
615.800605320764
888.431039804211
1129...

result:

ok 100000 numbers

Test #45:

score: 0
Accepted
time: 1321ms
memory: 4084kb

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.047651072016
824.887253224430
769.333695532164
585.410548843521
627.188961709529
729.223226125513
1662.046761050911
761.557662296712
715.555210849819
795.560526373517
854.163252511208
844.443152462502
922.972023963735
561.534770487714
648.066475641385
846.911263662134
905.322433994569
752.418076...

result:

ok 100000 numbers

Test #46:

score: 0
Accepted
time: 1253ms
memory: 3936kb

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.910773299199
1341.448874040385
1791.461167718918
1312.270253706590
84.925611013556
1376.397142300544
1225.757058887740
469.555278170600
523.289616662721
454.911294518231
1065.496346458254
1785.238405528762
306.030106630755
1026.478658043971
2144.849280395661
1029.256105046832
1053.362845729497
6...

result:

ok 100000 numbers

Test #47:

score: 0
Accepted
time: 1240ms
memory: 3932kb

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.003493758389
450.784501152474
1246.958822367561
1866.455110803675
1161.960303009793
1467.719402077705
1371.987203915847
343.598834879491
639.309103285882
1442.222511617068
1074.875181292327
664.023112704493
1428.348290954939
545.742118402609
1507.308725796702
1781.355757134793
1029.239161817037...

result:

ok 100000 numbers

Test #48:

score: 0
Accepted
time: 1269ms
memory: 3932kb

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.581477223260
396.561015793674
1449.654464144130
1556.878469810338
811.490173181233
1587.199171985096
624.831416206946
1202.667221040451
1497.848089663315
1888.787621382425
743.938897386153
614.899720986474
1882.665587019391
697.297043602819
1655.686601108155
1513.522039854481
1537.863680876667
1...

result:

ok 100000 numbers

Test #49:

score: 0
Accepted
time: 1282ms
memory: 4000kb

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.222150479632
1404.032519662649
728.053022820888
1327.942912287973
309.132459148992
1983.387140013557
1351.530962001991
1238.882356576839
679.305359934352
990.131803626760
899.672244930172
1572.782527828717
1036.934974863110
863.186669354860
1317.120801188609
804.065712635813
960.907407908467
992...

result:

ok 100000 numbers

Test #50:

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

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.254894580540
297.409790244692
940.043894195968
1405.243352952025
807.090036023451
1301.646105258006
1630.546316095135
883.725400411995
164.507092046083
1003.433836915862
561.932632550138
1119.117770090949
857.612634117566
402.087420318880
940.812827588124
1318.436450865832
424.507854601245
806....

result:

ok 100000 numbers

Test #51:

score: 0
Accepted
time: 1238ms
memory: 4056kb

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.003417307698
450.784333489123
956.553934658873
766.288055690586
764.806808929009
1640.091943154102
887.803545798106
625.200810013125
505.719078055595
1631.083464931620
1055.282867635568
610.403739787500
828.448978120000
495.540453223652
1836.038297916780
1228.310271129343
930.407008183332
76.58...

result:

ok 100000 numbers

Test #52:

score: 0
Accepted
time: 1269ms
memory: 3964kb

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.752058663835
1308.771594041071
655.703031267207
853.802765846101
1815.621936458003
1111.187984057126
878.879794770959
947.840554621063
845.610492501915
1171.706969459829
579.105278188886
1399.881253314657
1107.872569524643
556.781226976792
1902.854841973430
1400.118661288063
752.134182753277
959...

result:

ok 100000 numbers

Test #53:

score: 0
Accepted
time: 1265ms
memory: 4008kb

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.504868371219
1547.012784602905
514.280980198295
883.127281654366
1177.358728834978
1188.325676045502
393.649163123877
1789.300303347872
816.584304816124
953.105941805280
597.477250484481
800.945321432892
1218.847893385832
666.429456400030
728.754617887134
469.365172878217
595.410084290305
1129.6...

result:

ok 100000 numbers

Test #54:

score: 0
Accepted
time: 1231ms
memory: 3888kb

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.013073324937
2827.013014369892
2827.013073324931
2827.720032700091
2827.366523523937
2827.013073324913
2827.013014369902
2827.013073324911
2827.013014369895
2827.013014369902
2827.013014369895
2827.720032700089
2827.013014369902
2827.013014369892
2827.720032700089
2827.013073324937
2827.3665235...

result:

ok 100000 numbers

Test #55:

score: 0
Accepted
time: 1259ms
memory: 3884kb

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.187598897483
2821.714870570817
2823.834356372423
2823.129023134700
2825.246501678285
2821.013475684781
2823.129023134700
2821.718420215013
2825.953076922854
2825.952486929931
2820.656652285824
2826.659593692676
2827.720032700091
2825.246708149599
2822.423159909130
2823.129023134702
2826.3062320...

result:

ok 100000 numbers

Test #56:

score: 0
Accepted
time: 1233ms
memory: 3860kb

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.840861224114
2773.990071039017
2805.915255960228
2767.812139266396
2737.589335835698
2827.366494050091
2779.162742895656
2758.918989403287
2743.717523878950
2781.836533409709
2796.489837187195
2761.650628111872
2821.012914427526
2814.328426407227
2805.565466885935
2799.626044180829
2822.4231599...

result:

ok 100000 numbers

Test #57:

score: 0
Accepted
time: 1262ms
memory: 3956kb

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.042997358205
2304.983272385007
2533.741404724671
2415.818021822050
2746.782235640552
2217.191682225035
2380.765997941513
2433.127118759010
2522.913009868966
2338.996939369467
2740.657589828213
2767.325554256523
2400.823480152145
2163.235137788835
2567.814420998863
2587.412411027504
2644.4324005...

result:

ok 100000 numbers

Test #58:

score: 0
Accepted
time: 1235ms
memory: 4052kb

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.538686539830
2824.538775138461
2822.773563878738
2823.830960199557
2817.125127034344
2817.481126365352
2827.013014369892
2815.001764892304
2816.052993143228
2821.005815341579
2819.598909726429
2818.885412079823
2822.773563878738
2816.052993143224
2821.713924711846
2824.538066969646
2822.4231599...

result:

ok 100000 numbers

Test #59:

score: 0
Accepted
time: 1241ms
memory: 3844kb

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.248700937761
2737.643553073482
2809.766956754339
2785.915071566384
2775.024779872079
2768.917167183792
2738.620298596872
2776.292356149852
2756.782212760572
2744.380988981555
2733.384462431147
2776.431940486632
2768.511354756805
2769.796023991782
2785.988380596737
2771.469401337775
2794.0540339...

result:

ok 100000 numbers

Test #60:

score: 0
Accepted
time: 1267ms
memory: 4056kb

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.289651608367
2154.854368775417
2233.864306104589
2490.101958975196
2537.682122423975
2470.184352601563
2725.288741766046
2761.145218218847
2489.239230224154
2388.412225421308
2196.490934173436
2367.314007258597
2591.022159433712
2164.501854533439
2194.047100733727
2316.197792455669
2287.0206368...

result:

ok 100000 numbers

Test #61:

score: 0
Accepted
time: 1249ms
memory: 3928kb

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.213289526075
2725.931648820911
2769.398619561692
2741.652367221549
2737.751680945243
2762.486828788743
2744.887968998279
2746.707101685832
2774.841647936068
2693.131086657915
2754.481624100581
2776.592205850525
2825.245557187224
2780.888619469938
2675.741752336568
2722.854873691934
2814.9925258...

result:

ok 100000 numbers

Test #62:

score: 0
Accepted
time: 1279ms
memory: 4008kb

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.765883084875
2227.058270601370
2542.724107187765
2195.605144459169
2350.629329332825
2206.012224627810
2316.314891587270
2375.819903687641
2549.538346725596
2300.516309061615
2333.093880094742
2257.764311987019
2412.074088077150
2304.300487894853
2290.511472770266
2404.892847172813
2388.5134208...

result:

ok 100000 numbers

Test #63:

score: 0
Accepted
time: 1259ms
memory: 3976kb

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.958795637801
2259.222791880177
1533.103766780241
2194.889302527081
1963.493261419041
1835.231062010078
1835.074353425690
1776.557884812776
2201.858704232633
1616.668776842119
1833.798802294532
2654.478452997771
2726.691965381539
2127.965922640255
1889.172198127724
1759.920655630854
2183.5132941...

result:

ok 100000 numbers

Test #64:

score: 0
Accepted
time: 1286ms
memory: 3940kb

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.803296714050
838.659609674941
858.806795224837
1008.397063103602
708.539078006459
750.596237662948
953.734834488785
1065.273111637312
1112.265426217799
800.384636639365
851.906146453097
803.809294577948
1031.147674463551
891.036716078412
1060.535881342931
970.973620486379
883.323168348652
915.1...

result:

ok 100000 numbers

Test #65:

score: 0
Accepted
time: 1310ms
memory: 4012kb

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.347782926619
937.528923346845
1134.571576920079
942.527623777659
1363.435724729883
910.794485842718
868.449784128185
992.109299397559
916.398036328402
889.338401911996
903.119088231883
950.220917301850
818.142495497029
979.226587217254
889.853460570403
894.166281505920
886.934133684876
1026.1324...

result:

ok 100000 numbers

Test #66:

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

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.809041582063
942.691764366851
942.574898883750
1082.150160184638
2153.271465790244
2827.720121117871
2827.012970138857

result:

ok 7 numbers

Test #67:

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

input:

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

output:

1082.150160184638

result:

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

Extra Test:

score: 0
Extra Test Passed