QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#299122#7903. Computational Intelligenceucup-team087#WA 1419ms4160kbC++147.7kb2024-01-06 17:18:272024-01-06 17:18:28

Judging History

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

  • [2024-01-06 17:18:28]
  • 评测
  • 测评结果:WA
  • 用时:1419ms
  • 内存:4160kb
  • [2024-01-06 17:18:27]
  • 提交

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-12;

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 = 330;
constexpr int M = 20;

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 <= EPS) {
      // if (d <= 0) {
        // auto sub = [&](Double u) -> Double {
          // return sa * u*u/2;
        // };
        if (0 <= l) {
          // return sub(r) - sub(l);
          return sa/2 * (r*r - l*l);
        } else if (r <= 0) {
          // return sub(l) - sub(r);
          return sa/2 * (l*l - r*r);
        } else {
          // return sub(l) + sub(r)/* - 2 * sub(0)*/;
          return sa/2 * (l*l + r*r);
        }
      } 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)));
      }
    };
    
    // [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;
}

詳細信息

Test #1:

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

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: 4096kb

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

result:

ok 3 numbers

Test #3:

score: 0
Accepted
time: 1346ms
memory: 4148kb

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.744131448899
14.594278702892
2.952178245511
4.993502694148
6.058717255511
7.459408700250
11.228028907920
16.325707847495
11.072245157190
9.504557451155
5.500000000000
9.040049985829
5.326347910887
3.035934371290
5.808804183078
17.363719789522
9.995194519237
6.993302622881
6.55043322...

result:

ok 100000 numbers

Test #4:

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

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.272101354103
10.676587784399
4.048146349223
13.704168816512
5.960724885258
4.752273723773
5.808486858336
6.049334617408
4.212001303540
5.231052190723
7.816888558916
4.839493440445
6.085980058682
8.540849032638
6.899466200896
5.198575702567
7.92716381072...

result:

ok 100000 numbers

Test #5:

score: 0
Accepted
time: 424ms
memory: 3820kb

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: 425ms
memory: 3888kb

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: 1353ms
memory: 4060kb

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.879889741543
11.751734336573
7.387327468510
7.552508251824
4.795900554006
4.585511110017
11.636587321970
6.539467273582
8.155918942812
6.932750626113
3.744379817432
11.401172906234
16.839940311399
14.410838201436
6.386042190398
10.8509848...

result:

ok 100000 numbers

Test #8:

score: 0
Accepted
time: 1372ms
memory: 4092kb

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.429172495111
8.976426143538
7.486123031632
7.130299838220
6.028769291780
4.087930934617
4.823038522432
6.123128729387
7.246635688915
7.724226961177
10.316193728710
5.124308856571
4.791595303088
3.302047238927
2.312246344813
8.410214920626
13.517584456800
8.533966057093
8.5450889120...

result:

ok 100000 numbers

Test #9:

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

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: 1365ms
memory: 4028kb

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.596705004732
83.979645362575
49.327207070994
83.974820099519
163.879147592891
128.662991662278
86.719766612832
72.434035081339
120.317190035193
65.378944997323
38.467358046173
142.394344968573
172.484435283356
88.797397645167
103.861006339023
112.660658340549
53.222933957178
53.750870341578
119.3...

result:

ok 100000 numbers

Test #11:

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

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.366697243164
69.863330974219
43.490764400887
87.084290278514
26.087927019382
68.005214731301
83.472363923873
69.433387650764
86.012446756025
63.715166111858
33.878784640377
62.029070851066
66.298085751800
34.852023277610
40.565384049306
68.634388327685
69.446066473601
85.792227570740
88.739697776...

result:

ok 100000 numbers

Test #12:

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

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: 439ms
memory: 3788kb

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: 1364ms
memory: 4068kb

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.955105650847
65.811674713850
37.060285155775
46.813610979711
45.083939963339
74.735619795524
61.806243114659
136.507674639487
122.814089323194
92.257707076591
63.249310241008
163.589101250705
90.477077823376
124.397353658420
39.994842256189
86.476683977191
66.9079...

result:

ok 100000 numbers

Test #15:

score: 0
Accepted
time: 1403ms
memory: 4064kb

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.540916222223
55.550961539765
75.739380142002
83.071435678412
39.777700256265
101.947714522290
77.083991374080
94.066474164754
82.129527056629
82.889437065845
57.732847783009
63.883992880730
58.635820610958
103.974451216861
60.056323798113
24.086589316433
118.900466702855
41.307194...

result:

ok 100000 numbers

Test #16:

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

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: 1362ms
memory: 4160kb

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.388887977449
986.154539459444
675.175454690696
731.446775039546
271.783669719026
994.707291771487
1599.696102060806
655.579132413446
1290.257232189615
500.634041959786
1131.040173433255
1252.726588287103
736.804586666695
508.487554587866
909.408751371929
898.404205633220
693.489680345838
1108.4...

result:

ok 100000 numbers

Test #18:

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

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.587570591038
601.720709776388
631.819135731732
543.747869277022
1141.297157298269
897.087116435245
850.446807575546
993.820852795344
668.224532618055
237.791893931013
317.797310510352
248.830054766124
843.116541423362
454.656890013204
710.145619874814
742.534057362110
564.876910405507
998.895002...

result:

ok 100000 numbers

Test #19:

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

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.084574945547
411.028520232410
385.836177095352
560.438419652170
388.545435638557
412.043687004182
468.406073829109
327.268153727863
487.844806834670
773.056918991092
156.553150363986
264.639167337129
649.914951700947
555.641171180746
389.341007027369
221.932171820331
759.9761876...

result:

ok 100000 numbers

Test #20:

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

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.442771207125
53.763435013441
173.365381652611
900.975582355038
280.643902481419
471.218397113034
848.644212847764
474.746482053551
402.161106467987
666.687499674489
217.988711003575
357.430956813885
514.075329542709
216.241120562723
222.044039675816
410.785291308678
609.800172187578
445.04032276...

result:

ok 100000 numbers

Test #21:

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

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.208276690989
1056.720401249597
311.654867965556
714.636567887819
1164.816309948232
1274.091439263623
891.565373048440
570.655759763379
966.174623563183
1218.861856748169
537.988061217188
1086.364472652960
1227.393445747856
647.338865893997
398.215846520340
615.482980311298
662.026586745359
621.6...

result:

ok 100000 numbers

Test #22:

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

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.692625540727
668.264226748051
707.760535007333
478.444111982665
502.737922490939
194.597806683886
1483.235394330065
1131.249465590583
1485.945304173072
607.103926633520
645.865525221847
737.668438262770
830.467019786492
588.635942592847
480.155175324905
666.055126987974
723.149201887180
562.8817...

result:

ok 100000 numbers

Test #23:

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

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.964836259785
677.119799018034
458.883306395960
254.170764994281
443.034485740733
427.254933005785
620.952136283913
294.960637675229
229.987922388208
403.068783763323
181.502372191415
329.795391113946
51.009802979427
325.949041688694
431.532669034970
289.913780286485
318.47989645...

result:

ok 100000 numbers

Test #24:

score: -100
Wrong Answer
time: 1301ms
memory: 4136kb

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.055206262724
642.627255905015
417.543749320378
887.043338534067
1033.963798175748
1083.247249385785
1159.656271438414
1462.684034005059
1079.078619316884
1280.991929078534
376.522465022626
1844.758684940349
650.380757818413
1337.527806517438
598.672367233349
1067.942354207293
1086.287864967547
...

result:

wrong output format Expected double, but "-nan" found