QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#299275#7903. Computational Intelligenceucup-team087AC ✓1492ms4164kbC++147.9kb2024-01-06 18:18:512024-01-06 18:18:52

Judging History

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

  • [2024-01-06 18:18:52]
  • 评测
  • 测评结果:AC
  • 用时:1492ms
  • 内存:4164kb
  • [2024-01-06 18:18:51]
  • 提交

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 = 350;
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: 0ms
memory: 3924kb

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.765195716469
1.076635732895

result:

ok 3 numbers

Test #2:

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

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.070405024625

result:

ok 3 numbers

Test #3:

score: 0
Accepted
time: 1453ms
memory: 4156kb

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.744131448898
14.594278702892
2.952178245517
4.993502694125
6.058717255534
7.459408700250
11.228028907920
16.325707847495
11.072245157190
9.504557451156
5.500000000000
9.040049985829
5.326347910887
3.035934371290
5.808804183058
17.363719789522
9.995194519237
6.993302622881
6.55043322...

result:

ok 100000 numbers

Test #4:

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

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.516226342417
7.895152181059
7.619252804124
6.272101354102
10.676587784394
4.048146349223
13.704168816509
5.960724885256
4.752273723772
5.808486858335
6.049334617408
4.212001303540
5.231052190723
7.816888558915
4.839493440445
6.085980058681
8.540849032637
6.899466200895
5.198575702566
7.92716381072...

result:

ok 100000 numbers

Test #5:

score: 0
Accepted
time: 948ms
memory: 4124kb

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.518518518303
...

result:

ok 100000 numbers

Test #6:

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

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: 1451ms
memory: 4084kb

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.879889741481
11.751734336573
7.387327468522
7.552508251824
4.795900553897
4.585511109976
11.636587321970
6.539467273582
8.155918942813
6.932750626180
3.744379817400
11.401172906234
16.839940311399
14.410838201436
6.386042190398
10.8509848...

result:

ok 100000 numbers

Test #8:

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

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.797092276544
12.429172495107
8.976426143538
7.486123031632
7.130299838219
6.028769291778
4.087930934617
4.823038522432
6.123128729386
7.246635688914
7.724226961177
10.316193728710
5.124308856571
4.791595303088
3.302047238926
2.312246344813
8.410214920625
13.517584456800
8.533966057092
8.5450889120...

result:

ok 100000 numbers

Test #9:

score: 0
Accepted
time: 945ms
memory: 4036kb

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: 1464ms
memory: 4056kb

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.596705004729
83.979645362576
49.327207070993
83.974820099519
163.879147592891
128.662991662278
86.719766611342
72.434035081342
120.317190035193
65.378944997015
38.467358046173
142.394344968573
172.484435283356
88.797397645167
103.861006339023
112.660658340550
53.222933957128
53.750870341578
119.3...

result:

ok 100000 numbers

Test #11:

score: 0
Accepted
time: 1490ms
memory: 4096kb

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.366697243158
69.863330974219
43.490764400886
87.084290278505
26.087927019382
68.005214731292
83.472363923873
69.433387650765
86.012446756014
63.715166111848
33.878784640375
62.029070851063
66.298085751789
34.852023277617
40.565384049304
68.634388327682
69.446066473601
85.792227570713
88.739697776...

result:

ok 100000 numbers

Test #12:

score: 0
Accepted
time: 1040ms
memory: 4040kb

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: 1046ms
memory: 4040kb

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.064464615973
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: 1464ms
memory: 4072kb

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.955105650850
65.811674713634
37.060285155645
46.813610979712
45.083939963339
74.735619795525
61.806243114660
136.507674639486
122.814089323195
92.257707076592
63.249310241062
163.589101250705
90.477077823377
124.397353658420
39.994842256163
86.476683977190
66.9079...

result:

ok 100000 numbers

Test #15:

score: 0
Accepted
time: 1484ms
memory: 4104kb

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.467415419400
72.540916222217
55.550961539754
75.739380142001
83.071435678409
39.777700256265
101.947714522290
77.083991374080
94.066474164738
82.129527056536
82.889437065831
57.732847783009
63.883992880729
58.635820610957
103.974451216861
60.056323798101
24.086589316432
118.900466702855
41.307194...

result:

ok 100000 numbers

Test #16:

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

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: 1469ms
memory: 4140kb

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.388887977458
986.154539459446
675.175454690696
731.446775039518
271.783669719026
994.707291771486
1599.696102060805
655.579132413494
1290.257232189613
500.634041959791
1131.040173433254
1252.726588287098
736.804586666694
508.487554587864
909.408751371928
898.404205633220
693.489680345860
1108.4...

result:

ok 100000 numbers

Test #18:

score: 0
Accepted
time: 1486ms
memory: 4024kb

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.587570590975
601.720709776356
631.819135731686
543.747869276999
1141.297157298151
897.087116434922
850.446807575468
993.820852795344
668.224532618024
237.791893930922
317.797310510348
248.830054766106
843.116541423362
454.656890013207
710.145619874507
742.534057361983
564.876910405503
998.895002...

result:

ok 100000 numbers

Test #19:

score: 0
Accepted
time: 1052ms
memory: 4032kb

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.676401270707
741.084574945549
411.028520232410
385.836177095353
560.438419652171
388.545435638556
412.043687004181
468.406073829108
327.268153727863
487.844806834670
773.056918991092
156.553150363987
264.639167337129
649.914951700948
555.641171180747
389.341007027369
221.932171820331
759.9761876...

result:

ok 100000 numbers

Test #20:

score: 0
Accepted
time: 1058ms
memory: 4100kb

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.975582355037
280.643902481419
471.218397113035
848.644212847764
474.746482053550
402.161106467988
666.687499674489
217.988711003574
357.430956813885
514.075329542709
216.241120562724
222.044039675816
410.785291308678
609.800172187578
445.04032276...

result:

ok 100000 numbers

Test #21:

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

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.208276681479
1056.720401249589
311.654867965020
714.636567878212
1164.816309948229
1274.091439263623
891.565373048440
570.655759763401
966.174623563182
1218.861856748169
537.988061206050
1086.364472652927
1227.393445747861
647.338865893997
398.215846520339
615.482980311401
662.026586745358
621.6...

result:

ok 100000 numbers

Test #22:

score: 0
Accepted
time: 1483ms
memory: 4068kb

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.692625540723
668.264226747987
707.760535007334
478.444111982656
502.737922490949
194.597806683880
1483.235394330065
1131.249465590583
1485.945304173070
607.103926633520
645.865525221686
737.668438263195
830.467019786490
588.635942592847
480.155175324716
666.055126987939
723.149201886655
562.8817...

result:

ok 100000 numbers

Test #23:

score: 0
Accepted
time: 1062ms
memory: 4036kb

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.068783763323
181.502372191416
329.795391113945
51.009802979427
325.949041688693
431.532669034969
289.913780286485
318.47989645...

result:

ok 100000 numbers

Test #24:

score: 0
Accepted
time: 1412ms
memory: 3984kb

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.055206262726
642.627255905015
417.543749320378
887.043338534067
1033.963798175748
1083.247249385787
1159.656271438415
1462.684034005064
1079.078619316886
1280.991929078533
376.522465022626
1844.758684940346
650.380757818414
1337.527806517442
598.672367233350
1067.942354207293
1086.287864967546
...

result:

ok 100000 numbers

Test #25:

score: 0
Accepted
time: 1444ms
memory: 4164kb

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.327819608882
89.664930892756
438.610662549273
294.039562955966
726.646869193346
1066.960827747158
1491.524344522350
874.495482233949
806.061596839178
355.627132806736
1016.715075516237
1133.719572006710
1395.029276062255
1085.927489251558
842.229759374945
1234.808942726764
1826.020275383473
113...

result:

ok 100000 numbers

Test #26:

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

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.228978105586
1059.003861962646
1481.129275393590
1110.862188749128
1076.448877478025
1442.118782777035
939.294718171289
1219.511809833436
1281.365579249668
620.155741031846
985.291025898864
745.874942198439
1019.803799995588
345.074869313854
1199.570246064474
1075.480714903241
883.426648901685
...

result:

ok 100000 numbers

Test #27:

score: 0
Accepted
time: 1475ms
memory: 4100kb

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.367986250951
969.871725503555
533.148428974769
1532.609584915469
822.844217405504
1452.875212585090
1326.826208587973
740.521997639903
833.741732674577
1200.738293976586
961.075121038469
1028.980058346834
794.077305214247
530.437904036849
763.050504619673
848.339948867019
773.51...

result:

ok 100000 numbers

Test #28:

score: 0
Accepted
time: 1411ms
memory: 4128kb

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.673810471120
1425.083974133934
1549.075315578086
545.297472333793
229.683115040433
984.415731961524
1215.348646822544
1929.838421561076
890.056365256364
1527.409680908609
682.440717816215
1575.633629157918
241.373845587724
1183.697737318682
212.250638007106
1475.244160582704
764.068932317870
86...

result:

ok 100000 numbers

Test #29:

score: 0
Accepted
time: 1405ms
memory: 4128kb

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.082082348582
1692.128047356226
799.389660667018
752.374172957147
434.250648435274
825.568179950594
1391.966914789645
1007.707363027531
692.449716341228
2011.878589857436
1546.166997023862
1072.783939825042
1535.843993622118
1741.921947021091
1943.882128426470
1344.741506926871
786.810936038030
1...

result:

ok 100000 numbers

Test #30:

score: 0
Accepted
time: 1453ms
memory: 4032kb

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.825038673964
178.115376566587
1619.151035341416
1095.760172926254
1987.499581101595
927.310582104294
967.473850235680
1306.482567081908
814.247625934595
1407.220066011960
779.377072642719
954.145522778462
662.209039717791
798.624420519601
952.897171629109
606.886986718878
573.9...

result:

ok 100000 numbers

Test #31:

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

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.350054144635
1041.544738384722
1215.504188566771
668.942839880682
818.345050504472
835.242068061043
862.669742322685
1219.582807086224
1021.598350772996
592.817878248620
970.977291724187
645.147160878496
1484.872966239412
1499.728031268413
987.139699997442
1712.115172808196
1192.115484827052
649...

result:

ok 100000 numbers

Test #32:

score: 0
Accepted
time: 1415ms
memory: 4068kb

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.813590647044
950.849795868086
1124.318163767407
1721.925472716466
812.997745428401
1010.024422578304
1075.627413829676
1036.975570604331
2360.498534917646
1353.160128668593
979.417344119853
1329.069724797729
632.422590913173
329.542624601389
1359.930635656050
638.745125439607
697.837612698549
10...

result:

ok 100000 numbers

Test #33:

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

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.868357635562
1106.707510317249
1004.727340749606
1448.835414708061
82.264078490165
1476.620919064839
1130.317817675095
1273.980128639458
886.029149822845
913.982470165373
968.046292754521
1176.439751169791
1276.155184522748
925.087549038024
1114.457005149678
782.290183188422
8...

result:

ok 100000 numbers

Test #34:

score: 0
Accepted
time: 1451ms
memory: 4040kb

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.320351118370
945.764002180159
1067.512077777219
630.583551664361
1208.114227411676
1135.904082433193
1213.196464618120
731.926505849869
1432.290376523549
1357.928734810589
939.387544447188
1599.508235047071
864.821726882025
800.848403082477
753.505913642525
1085...

result:

ok 100000 numbers

Test #35:

score: 0
Accepted
time: 1454ms
memory: 4096kb

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.817297884706
379.927000483986
1746.949952771796
228.505484559958
1337.771141337922
749.162665744492
977.445307596500
726.148265366828
555.412550795578
480.858627355748
873.539323447609
1093.314580040030
1217.379888523914
1287.466699811020
904.790510898890
2012.908366725706
1667.983609288609
454...

result:

ok 100000 numbers

Test #36:

score: 0
Accepted
time: 1446ms
memory: 4032kb

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.372991323114
878.740469671617
725.335783024036
697.212296334951
975.759483554773
967.467252248355
817.116507518558
1000.446906012292
554.619956548053
905.523214448852
634.059712297157
662.587726797098
940.988468517313
693.891900875890
1461.170864271199
641.055365082260
949.522062472996
534.97688...

result:

ok 100000 numbers

Test #37:

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

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.489730313065
897.987853786211
1418.646011658163
1150.514777855552
1081.809528197200
1066.092167613073
1344.503302176041
1065.978493854162
1141.905762052070
1107.059863010680
1059.286039567223
1186.830705765901
884.840166218306
1241.863299033321
1150.356238849035
964.007053690184
835.760130284972...

result:

ok 100000 numbers

Test #38:

score: 0
Accepted
time: 1408ms
memory: 4160kb

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.577642613437
863.079687389945
1648.445606220208
1160.947522440753
1803.917172895320
1125.636227502797
1647.332711438776
1399.010842815621
1089.201136265141
1220.780556310865
528.309569335600
547.271944939041
347.555631040189
1450.152721842321
619.348628928573
701.206341481246
1165.369004507463
4...

result:

ok 100000 numbers

Test #39:

score: 0
Accepted
time: 1414ms
memory: 4096kb

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.545136554728
440.368765320240
1324.559895486346
1334.032605378170
990.215928105335
1178.634541741849
289.974424765836
503.285875239619
1291.718848440085
1431.553555890127
647.732327870092
1052.778189831139
997.677260784638
2118.037043271223
1655.072769586559
1422.540626556711
8...

result:

ok 100000 numbers

Test #40:

score: 0
Accepted
time: 1452ms
memory: 4104kb

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.880961046079
257.845188657210
688.284209161774
701.562066646188
1369.239577659914
1279.872697215198
1527.929979140818
630.167386775684
401.716373486694
728.480744785159
519.825049388961
1531.225946016454
1241.196862815848
1131.257783527058
554.598025536149
805.280101221609
634.848284068854
880....

result:

ok 100000 numbers

Test #41:

score: 0
Accepted
time: 1486ms
memory: 4152kb

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.386641172299
952.787966821704
853.879811782092
644.960743837605
965.481696491521
739.693166808013
839.425663612978
941.417022048016
670.531614426916
519.569267214192
987.687625798343
954.936945493774
772.162011377238
1001.192776154499
1225.757987737493
956.701197863739
478.463433403941
716.11510...

result:

ok 100000 numbers

Test #42:

score: 0
Accepted
time: 1411ms
memory: 4136kb

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.577369573583
995.215688765778
187.962775935997
1160.947589395956
1803.917218792613
998.664494092322
1647.332593664941
675.080921606286
1089.200893182324
1220.780509792787
528.309622578014
918.994867526175
957.449596283006
843.595429945773
619.349043366296
110.788882504591
707.649667697250
636.45...

result:

ok 100000 numbers

Test #43:

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

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.610133233828
853.413558746814
440.331842600629
868.218832439234
283.921937713501
2583.938469312615
822.236381030202
663.699855296421
198.808734693293
1276.233746373292
514.590973642146
1160.784557616291
416.851310435410
1020.465111087680
2099.592875552463
661.446640401052
338.965931282298
1564.3...

result:

ok 100000 numbers

Test #44:

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

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.987753428018
304.697067157617
1341.355283850666
138.597623701728
1739.748811540414
1338.299718509982
588.188128470527
604.198072200113
1314.849430606606
864.451629923290
1385.450263061242
1121.566525378516
803.234100471001
1195.465747105930
615.800605320764
888.431039804210
1129...

result:

ok 100000 numbers

Test #45:

score: 0
Accepted
time: 1449ms
memory: 4096kb

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.047651072027
824.887253225039
769.333695532234
585.410548843522
627.188961710201
729.223226125516
1662.046761050913
761.557662296815
715.555210849843
795.560526373529
854.163252517459
844.443152463320
922.972023963750
561.534770488946
648.066475641386
846.911263662926
905.322433994574
752.418076...

result:

ok 100000 numbers

Test #46:

score: 0
Accepted
time: 1412ms
memory: 4140kb

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.448874040380
1791.461167718915
1312.270253706588
84.925611013556
1376.397142300544
1225.757058887740
469.555278170602
523.289616662722
454.911294518231
1065.496346458257
1785.238405528767
306.030106630755
1026.478658043970
2144.849280395666
1029.256105046832
1053.362845729497
6...

result:

ok 100000 numbers

Test #47:

score: 0
Accepted
time: 1416ms
memory: 4068kb

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.784501152473
1246.958822367559
1866.455110803681
1161.960303009792
1467.719402077707
1371.987203915848
343.598834879491
639.309103285882
1442.222511617066
1074.875181292328
664.023112704492
1428.348290954939
545.742118402609
1507.308725796704
1781.355757134789
1029.239161817037...

result:

ok 100000 numbers

Test #48:

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

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.654464144128
1556.878469810336
811.490173181234
1587.199171985093
624.831416206946
1202.667221040450
1497.848089663316
1888.787621382426
743.938897386153
614.899720986475
1882.665587019393
697.297043602819
1655.686601108151
1513.522039854481
1537.863680876667
1...

result:

ok 100000 numbers

Test #49:

score: 0
Accepted
time: 1458ms
memory: 4040kb

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.222150479631
1404.032519662633
728.053022820894
1327.942912287973
309.132459142202
1983.387140013556
1351.530962001990
1238.882356576839
679.305359932546
990.131803626761
899.672244930217
1572.782527828718
1036.934974863110
863.186669354861
1317.120801188609
804.065712635824
960.907407908463
992...

result:

ok 100000 numbers

Test #50:

score: 0
Accepted
time: 1409ms
memory: 4104kb

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.254894580537
297.409790244692
940.043894195967
1405.243352952023
807.090036023452
1301.646105258008
1630.546316095134
883.725400411993
164.507092046083
1003.433836915865
561.932632550138
1119.117770090948
857.612634117565
402.087420318880
940.812827588124
1318.436450865829
424.507854601246
806....

result:

ok 100000 numbers

Test #51:

score: 0
Accepted
time: 1474ms
memory: 4152kb

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.003417307697
450.784333489123
956.553934658873
766.288055690586
764.806808929009
1640.091943154101
887.803545798106
625.200810013124
505.719078055596
1631.083464931620
1055.282867635568
610.403739787500
828.448978120000
495.540453223653
1836.038297916778
1228.310271129344
930.407008183331
76.58...

result:

ok 100000 numbers

Test #52:

score: 0
Accepted
time: 1450ms
memory: 4048kb

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.752058663834
1308.771594041071
655.703031267206
853.802765846102
1815.621936458002
1111.187984057126
878.879794770958
947.840554621062
845.610492501912
1171.706969459830
579.105278188886
1399.881253314660
1107.872569524644
556.781226976793
1902.854841973428
1400.118661288062
752.134182753277
959...

result:

ok 100000 numbers

Test #53:

score: 0
Accepted
time: 1458ms
memory: 4104kb

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.012784602910
514.280980198299
883.127281654366
1177.358728834976
1188.325676045502
393.649163123877
1789.300303347871
816.584304816124
953.105941805279
597.477250484481
800.945321432891
1218.847893385831
666.429456400030
728.754617887135
469.365172878219
595.410084290305
1129.6...

result:

ok 100000 numbers

Test #54:

score: 0
Accepted
time: 1411ms
memory: 4096kb

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.013073324928
2827.013014369890
2827.013073324923
2827.720032700073
2827.366523523920
2827.013073324913
2827.013014369890
2827.013073324912
2827.013014369891
2827.013014369890
2827.013014369891
2827.720032700069
2827.013014369890
2827.013014369890
2827.720032700068
2827.013073324928
2827.3665235...

result:

ok 100000 numbers

Test #55:

score: 0
Accepted
time: 1411ms
memory: 4060kb

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.187598897479
2821.714870570820
2823.834356372428
2823.129023134700
2825.246501678287
2821.013475684776
2823.129023134700
2821.718420215014
2825.953076922859
2825.952486929920
2820.656652285827
2826.659593692688
2827.720032700073
2825.246708149604
2822.423159909128
2823.129023134702
2826.3062320...

result:

ok 100000 numbers

Test #56:

score: 0
Accepted
time: 1416ms
memory: 4068kb

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.840861224112
2773.990071039017
2805.915255960225
2767.812139266396
2737.589335835701
2827.366494050099
2779.162742895653
2758.918989403288
2743.717523878951
2781.836533409706
2796.489837187194
2761.650628111871
2821.012914427529
2814.328426407228
2805.565466885936
2799.626044180829
2822.4231599...

result:

ok 100000 numbers

Test #57:

score: 0
Accepted
time: 1436ms
memory: 4100kb

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.983272385013
2533.741404724673
2415.818021822053
2746.782235640550
2217.191682225036
2380.765997941516
2433.127118759009
2522.913009868972
2338.996939369468
2740.657589828209
2767.325554256525
2400.823480152144
2163.235137788838
2567.814420998865
2587.412411027504
2644.4324005...

result:

ok 100000 numbers

Test #58:

score: 0
Accepted
time: 1395ms
memory: 4100kb

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.538686539832
2824.538775138466
2822.773563878744
2823.830960199559
2817.125127034344
2817.481126365353
2827.013014369890
2815.001764892304
2816.052993143227
2821.005815341579
2819.598909726431
2818.885412079829
2822.773563878744
2816.052993143229
2821.713924711843
2824.538066969645
2822.4231599...

result:

ok 100000 numbers

Test #59:

score: 0
Accepted
time: 1413ms
memory: 4096kb

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.248700937757
2737.643553073485
2809.766956754343
2785.915071566382
2775.024779872077
2768.917167183788
2738.620298596870
2776.292356149855
2756.782212760577
2744.380988981555
2733.384462431151
2776.431940486630
2768.511354756807
2769.796023991787
2785.988380596734
2771.469401337777
2794.0540339...

result:

ok 100000 numbers

Test #60:

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

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.289651608364
2154.854368775420
2233.864306104590
2490.101958975197
2537.682122423977
2470.184352601567
2725.288741766045
2761.145218218848
2489.239230224153
2388.412225421311
2196.490934173438
2367.314007258600
2591.022159433713
2164.501854533441
2194.047100733727
2316.197792455668
2287.0206368...

result:

ok 100000 numbers

Test #61:

score: 0
Accepted
time: 1430ms
memory: 4028kb

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.213289526074
2725.931648820909
2769.398619561689
2741.652367221548
2737.751680945246
2762.486828788745
2744.887968998280
2746.707101685832
2774.841647936065
2693.131086657914
2754.481624100579
2776.592205850527
2825.245557187228
2780.888619469938
2675.741752336569
2722.854873691932
2814.9925258...

result:

ok 100000 numbers

Test #62:

score: 0
Accepted
time: 1451ms
memory: 4024kb

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.765883084877
2227.058270601369
2542.724107187769
2195.605144459169
2350.629329332823
2206.012224627811
2316.314891587271
2375.819903687639
2549.538346725597
2300.516309061616
2333.093880094742
2257.764311987019
2412.074088077148
2304.300487894857
2290.511472770266
2404.892847172813
2388.5134208...

result:

ok 100000 numbers

Test #63:

score: 0
Accepted
time: 1457ms
memory: 4160kb

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.958795637804
2259.222791880180
1533.103766780241
2194.889302527079
1963.493261419037
1835.231062010077
1835.074353425689
1776.557884812779
2201.858704232632
1616.668776842118
1833.798802294532
2654.478452997771
2726.691965381538
2127.965922640258
1889.172198127724
1759.920655630855
2183.5132941...

result:

ok 100000 numbers

Test #64:

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

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.803296714174
838.659609669617
858.806795224889
1008.397063103969
708.539078005633
750.596237652815
953.734834468570
1065.273111637565
1112.265426217984
800.384636639845
851.906146453470
803.809294578926
1031.147674442474
891.036716078783
1060.535881343142
970.973620510088
883.323168342839
915.1...

result:

ok 100000 numbers

Test #65:

score: 0
Accepted
time: 1487ms
memory: 4076kb

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.347782900285
937.528923327331
1134.571576932587
942.527623703843
1363.435724751139
910.794485792613
868.449784115918
992.109299347594
916.398036327213
889.338401871223
903.119088195023
950.220917300648
818.142495421066
979.226587195299
889.853460574616
894.166281471228
886.934133628920
1026.1324...

result:

ok 100000 numbers

Test #66:

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

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.809041582064
942.691764371175
942.574898892460
1082.150160150921
2153.271465790297
2827.720121117897
2827.012970138863

result:

ok 7 numbers

Test #67:

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

input:

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

output:

1082.150160150921

result:

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

Extra Test:

score: 0
Extra Test Passed