QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#75462#5461. Paddle Starrin204AC ✓167ms3752kbC++177.5kb2023-02-05 11:58:572023-02-05 11:59:01

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-02-05 11:59:01]
  • 评测
  • 测评结果:AC
  • 用时:167ms
  • 内存:3752kb
  • [2023-02-05 11:58:57]
  • 提交

answer

// #pragma GCC target("avx2")
// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
using namespace std;

using ll = long long;
using ull = unsigned long long;
template <class T>
using pq = priority_queue<T>;
template <class T>
using qp = priority_queue<T, vector<T>, greater<T>>;
#define vec(T, A, ...) vector<T> A(__VA_ARGS__);
#define vvec(T, A, h, ...) vector<vector<T>> A(h, vector<T>(__VA_ARGS__));
#define vvvec(T, A, h1, h2, ...) vector<vector<vector<T>>> A(h1, vector<vector<T>>(h2, vector<T>(__VA_ARGS__)));

#define endl "\n"
#define spa ' '
#define len(A) A.size()
#define all(A) begin(A), end(A)

#define fori1(a) for(ll _ = 0; _ < (a); _++)
#define fori2(i, a) for(ll i = 0; i < (a); i++)
#define fori3(i, a, b) for(ll i = (a); i < (b); i++)
#define fori4(i, a, b, c) for(ll i = (a); ((c) > 0 || i > (b)) && ((c) < 0 || i < (b)); i += (c))
#define overload4(a, b, c, d, e, ...) e
#define fori(...) overload4(__VA_ARGS__, fori4, fori3, fori2, fori1)(__VA_ARGS__)

template <typename T>
vector<tuple<ll, T>> ENUMERATE(vector<T> &A, ll s = 0){
    vector<tuple<ll, T>> ret(A.size());
    for(int i = 0; i < A.size(); i++) ret[i] = {i + s, A[i]};
    return ret;
}

vector<tuple<ll, char>> ENUMERATE(string &A, ll s = 0){
    vector<tuple<ll, char>> ret(A.size());
    for(int i = 0; i < A.size(); i++) ret[i] = {i + s, A[i]};
    return ret;
}

#define enum1(A) fori(A.size())
#define enum2(a, A) for(auto a:A)
#define enum3(i, a, A) for(auto&& [i, a]: ENUMERATE(A))
#define enum4(i, a, A, s) for(auto&& [i, a]: ENUMERATE(A, s))
#define enum(...) overload4(__VA_ARGS__, enum4, enum3, enum2, enum1)(__VA_ARGS__)

template <typename T, typename S>
vector<tuple<T, S>> ZIP(vector<T> &A, vector<S> &B){
    int n = min(A.size(), B.size());
    vector<tuple<T, S>> ret(n);
    for(int i = 0; i < n; i++) ret[i] = {A[i], B[i]};
    return ret;
}

template <typename T, typename S>
vector<tuple<ll, T, S>> ENUMZIP(vector<T> &A, vector<S> &B, ll s = 0){
    int n = min(A.size(), B.size());
    vector<tuple<ll, T, S>> ret(n);
    for(int i = 0; i < n; i++) ret[i] = {i + s, A[i], B[i]};
    return ret;
}

#define zip4(a, b, A, B) for(auto&& [a, b]: ZIP(A, B))
#define enumzip5(i, a, b, A, B) for(auto&& [i, a, b]: ENUMZIP(A, B))
#define enumzip6(i, a, b, A, B, s) for(auto&& [i, a, b]: ENUMZIP(A, B, s))
#define overload6(a, b, c, d, e, f, g, ...) g
#define zip(...) overload6(__VA_ARGS__, enumzip6, enumzip5, zip4, _, _, _)(__VA_ARGS__)

vector<char> stoc(string &S){
    int n = S.size();
    vector<char> ret(n);
    for(int i = 0; i < n; i++) ret[i] = S[i];
    return ret;
}

#define INT(...) int __VA_ARGS__; inp(__VA_ARGS__);
#define LL(...) ll __VA_ARGS__; inp(__VA_ARGS__);
#define STRING(...) string __VA_ARGS__; inp(__VA_ARGS__);
#define CHAR(...) char __VA_ARGS__; inp(__VA_ARGS__);
#define VEC(T, A, n) vector<T> A(n); inp(A);
#define VVEC(T, A, n, m) vector<vector<T>> A(n, vector<T>(m)); inp(A);

const ll MOD1 = 1000000007;
const ll MOD9 = 998244353;

template<class T> auto min(const T& a){
    return *min_element(all(a));
}
template<class T> auto max(const T& a){
    return *max_element(all(a));
}
template <class T, class S>
inline bool chmax(T &a, const S &b) {
  return (a < b ? a = b, 1 : 0);
}
template <class T, class S>
inline bool chmin(T &a, const S &b) {
  return (a > b ? a = b, 1 : 0);
}

void FLUSH(){cout << flush;}
void print(){cout << endl;}
template <class Head, class... Tail>
void print(Head &&head, Tail &&... tail) {
    cout << head;
    if (sizeof...(Tail)) cout << spa;
    print(forward<Tail>(tail)...);
}
template<typename T>
void print(vector<T> &A){
    int n = A.size();
    for(int i = 0; i < n; i++){
        cout << A[i];
        if(i == n - 1) cout << endl;
        else cout << spa;
    }
}
template<typename T>
void print(vector<vector<T>> &A){
    for(auto &row: A) print(row);
}
template<typename T, typename S>
void print(pair<T, S> &A){
    cout << A.first << spa << A.second << endl;
}
template<typename T, typename S>
void print(vector<pair<T, S>> &A){
    for(auto &row: A) print(row);
}
template<typename T, typename S>
void prisep(vector<T> &A, S sep){
    int n = A.size();
    for(int i = 0; i < n; i++){
        cout << A[i];
        if(i == n - 1) cout << endl;
        else cout << sep;
    }
}
template<typename T, typename S>
void priend(T A, S end){
    cout << A << end;
}
template<typename T>
void priend(T A){
    priend(A, spa);
}
template<class... T>
void inp(T&... a){
    (cin >> ... >> a);
}
template<typename T>
void inp(vector<T> &A){
    for(auto &a:A) cin >> a;
}
template<typename T>
void inp(vector<vector<T>> &A){
    for(auto &row:A) inp(row);
}
template<typename T, typename S>
void inp(pair<T, S> &A){
    inp(A.first, A.second);
}
template<typename T, typename S>
void inp(vector<pair<T, S>> &A){
    for(auto &row: A) inp(row.first, row.second);
}

template<typename T>
T sum(vector<T> &A){
    T tot = 0;
    for(auto a:A) tot += a;
    return tot;
}

template<typename T>
pair<vector<T>, map<T, int>> compression(vector<T> X){
    sort(all(X));
    X.erase(unique(all(X)), X.end());
    map<T, int> mp;
    for(int i = 0; i < X.size(); i++) mp[X[i]] = i;
    return {X, mp};
}

using ld = long double;
const ld PI = acos(-1);

complex<ld> intersection(complex<ld> &p1, complex<ld> &p2, complex<ld> &p3, complex<ld> &p4){
    ld det = (p1.real() - p2.real()) * (p4.imag() - p3.imag()) - (p4.real() - p3.real()) * (p1.imag() - p2.imag());
    ld t = ((p4.imag() - p3.imag()) * (p4.real() - p2.real()) + (p3.real() - p4.real()) * (p4.imag() - p2.imag())) / det;
    ld x = t * p1.real() + (1.0 - t) * p2.real();
    ld y = t * p1.imag() + (1.0 - t) * p2.imag();
    return complex<ld>{x, y};
}

void solve(){
    INT(L1, L2, alpha, beta);
    ld l1 = L1;
    ld l2 = L2;
    ld alrad = ld(alpha * PI / 180.0);
    ld berad = ld(beta * PI / 180.0);
    ld ans = 0;
    ld l = l1 + l2;
    ans += l * l * alrad;
    ans += l2 * l2 * berad;
    if((beta <= 90) || (beta == 180)){
        print(ans);
        return;
    }
    complex<ld> O, pr, pl, qr, ql;
    O = {0, 0};
    pr = l1 * complex<ld>{cos(PI / 2 - alrad), sin(PI / 2 - alrad)};
    pl = l1 * complex<ld>{cos(PI / 2 + alrad), sin(PI / 2 + alrad)};
    qr = pr + l2 * complex<ld>{cos(PI / 2 - alrad - berad), sin(PI / 2 - alrad - berad)};
    ql = pl + l2 * complex<ld>{cos(PI / 2 + alrad - berad), sin(PI / 2 + alrad - berad)};

    auto projection=[](complex<ld> &a, complex<ld> &b, complex<ld> &p){
        auto d1 = p - a;
        auto d2 = a - b;
        ld t = (d1.real() * d2.real() + d1.imag() * d2.imag()) / norm(a - b);
        return a + (a - b) * t;
    };

    auto pqro = projection(pr, qr, O);
    if(pqro.imag() > qr.imag()) qr = pqro;

    ld theta = atan2(qr.imag(), qr.real());
    ld dtheta = PI / 2 - alrad - theta;
    ld darea = 0;
    ld r = abs(qr);
    darea += abs(pr.imag() * qr.real() - pr.real() * qr.imag()) / 2.0;
    if(dtheta <= 2 * alrad){
        darea -= r * r * dtheta / 2.0;
    }
    else{
        darea -= r * r * 2.0 * alrad / 2.0;
        auto pq = qr * complex<ld>{cos(alrad * 2), sin(alrad * 2)};
        complex<ld> ppp = {cos(PI / 2.0 - alrad * 3.0), sin(PI / 2.0 - alrad * 3.0)};
        auto pp = intersection(O, ppp, pr, qr);
        pr /= abs(pr);
        pr *= abs(pp);

        darea -= abs(pr.imag() * pq.real() - pr.real() * pq.imag()) / 2.0;
    }
    // print(ans, darea);
    ans += 2 * darea;
    print(ans);

}

int main(){
    cin.tie(0)->sync_with_stdio(0);
    cout << fixed << setprecision(12);
    int t;
    t = 1;
    cin >> t;
    while(t--) solve();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 3744kb

input:

5
2 1 20 20
3 3 0 0
20 20 90 120
20 10 50 170
100 10 1 93

output:

3.490658503989
0.000000000000
3367.157611906511
1098.863278984082
373.960489570088

result:

ok 5 numbers

Test #2:

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

input:

100000
88 12 24 116
79 15 84 150
96 52 31 141
100 100 81 29
83 29 71 99
95 92 5 87
99 97 39 72
79 72 20 65
67 39 60 116
100 89 1 62
78 77 63 45
62 34 83 178
92 49 24 103
94 73 66 49
20 14 24 51
100 97 66 109
94 94 86 82
82 79 49 67
76 38 88 118
92 79 58 112
93 23 40 167
87 34 13 25
96 18 73 15
94 38...

output:

4526.991613202875
13636.479265474325
19433.170502612670
61610.122595399832
17006.233726987326
15903.667036975090
37972.639843450069
13840.111902464634
14968.804520318270
9194.795925234087
31073.492936656644
16982.120743226402
12675.930420194697
36683.242951954218
658.687259702660
62718.197215759167
...

result:

ok 100000 numbers

Test #3:

score: 0
Accepted
time: 106ms
memory: 3636kb

input:

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

output:

0.000000000000
0.017453292520
0.034906585040
0.052359877560
0.069813170080
0.087266462600
0.104719755120
0.122173047640
0.139626340160
0.157079632679
0.174532925199
0.191986217719
0.209439510239
0.226892802759
0.244346095279
0.261799387799
0.279252680319
0.296705972839
0.314159265359
0.331612557879
...

result:

ok 100000 numbers

Test #4:

score: 0
Accepted
time: 98ms
memory: 3636kb

input:

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

output:

0.000000000000
0.017453292520
0.034906585040
0.052359877560
0.069813170080
0.087266462600
0.104719755120
0.122173047640
0.139626340160
0.157079632679
0.174532925199
0.191986217719
0.209439510239
0.226892802759
0.244346095279
0.261799387799
0.279252680319
0.296705972839
0.314159265359
0.331612557879
...

result:

ok 100000 numbers

Test #5:

score: 0
Accepted
time: 2ms
memory: 3748kb

input:

1
1 1 0 0

output:

0.000000000000

result:

ok found '0.0000000', expected '0.0000000', error '-0.0000000'

Test #6:

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

input:

100000
2 1 24 89
3 1 76 68
2 2 52 144
3 3 4 2
2 2 86 44
3 2 87 123
3 2 2 53
3 1 50 172
3 3 86 156
2 2 46 1
3 3 74 71
2 2 20 104
2 2 29 86
3 3 2 30
2 2 26 178
3 2 14 108
3 3 90 69
3 2 13 175
3 3 52 35
2 2 73 31
3 3 77 105
3 1 86 143
3 3 50 109
3 1 13 94
3 2 41 139
2 2 51 154
2 1 57 40
3 3 27 112
2 2 ...

output:

5.323254218583
22.410027595607
25.173876620134
2.827433388231
27.087509990952
47.012886069757
4.572762640225
17.101525659349
80.168864241398
12.915436464758
57.648225193373
12.864384636389
14.102260356114
5.969026041821
19.818865672108
13.736070861025
67.387162419501
18.233437656637
38.170350741116
...

result:

ok 100000 numbers

Test #7:

score: 0
Accepted
time: 2ms
memory: 3620kb

input:

1
1 1 1 1

output:

0.087266462600

result:

ok found '0.0872665', expected '0.0872665', error '0.0000000'

Test #8:

score: 0
Accepted
time: 128ms
memory: 3636kb

input:

100000
71 6 33 34
98 20 79 171
88 16 59 8
45 21 36 79
88 61 44 149
55 47 72 86
81 8 85 122
68 2 35 71
98 91 79 49
73 19 68 148
69 66 81 22
99 94 87 130
65 53 43 53
97 89 84 1
93 88 77 6
83 46 2 51
83 69 46 95
91 55 17 137
93 84 1 54
61 45 74 15
77 65 0 21
84 71 6 32
87 81 37 76
91 55 32 154
73 34 76...

output:

3436.221684618956
20453.899714220959
11173.458244927538
3345.010777909732
27858.125443027413
16389.723780362991
11913.368920826426
2998.196402245939
56334.480958811532
11128.116724082295
27437.570679024497
77419.259170279996
13048.238567542287
50858.632603726963
44838.573134578042
2464.369997230953
...

result:

ok 100000 numbers

Test #9:

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

input:

100000
10 1 40 160
6 6 27 16
10 10 7 41
4 1 38 161
7 6 66 143
6 4 26 127
8 4 47 99
4 4 49 121
5 2 68 122
8 8 27 178
10 8 73 125
6 2 20 175
10 1 34 13
7 4 66 102
10 10 14 179
9 7 64 120
7 5 47 169
10 8 68 90
8 2 37 3
5 5 10 164
4 2 26 62
7 5 43 40
1 1 35 103
10 7 71 102
6 1 90 63
6 4 49 44
6 3 84 123...

output:

87.584913357908
77.911497809027
120.427718387609
19.690923988661
291.658182925004
83.318489580253
145.851363237235
89.226195379334
67.671999442581
321.571228728412
558.426573154582
34.903934826530
72.029738229806
168.011900637173
411.827515292431
391.845507899691
196.280472187850
485.061905714264
64...

result:

ok 100000 numbers

Test #10:

score: 0
Accepted
time: 120ms
memory: 3612kb

input:

100000
8 8 89 18
10 1 17 44
6 1 43 5
11 10 84 74
11 11 64 172
10 7 85 51
7 6 71 176
9 7 51 99
5 3 12 54
6 5 26 32
3 2 21 23
10 10 59 151
9 9 81 45
7 4 2 37
11 6 3 172
11 10 65 98
11 10 78 173
7 2 9 104
10 9 46 77
8 3 24 100
11 9 77 41
10 10 55 30
11 6 37 75
9 7 25 56
10 9 14 7
9 9 12 179
11 9 6 130
...

output:

417.762009757363
36.669367584401
36.861353802120
775.694132756360
917.192986614325
472.355908759745
322.464590122768
312.639212169689
21.886428820009
68.870692283696
10.768681484805
692.821232732176
521.661460128585
14.556045961633
127.726396981381
671.449407348259
913.466888314433
20.213846371293
3...

result:

ok 100000 numbers

Test #11:

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

input:

100000
7 3 55 160
4 3 14 72
9 7 4 52
9 9 31 71
12 1 87 116
9 7 10 154
12 10 20 100
6 5 61 69
12 12 55 130
12 11 7 163
4 3 43 178
11 11 42 155
12 1 20 1
5 3 72 151
7 2 74 136
10 10 66 76
11 11 84 176
8 6 59 110
12 2 54 47
12 12 38 28
12 12 38 105
12 12 60 173
12 4 48 76
2 1 71 31
3 1 21 123
12 7 83 2...

output:

123.848168841707
23.282692221604
62.343160881237
275.674755352504
258.992530853761
187.418244337320
343.731350761199
158.929681686604
891.558109336301
425.573601551489
65.047404023752
703.955421939029
59.009582009928
107.152855427087
115.790851181558
593.411945678072
1088.802599177088
271.7872108174...

result:

ok 100000 numbers

Test #12:

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

input:

100000
12 8 12 17
7 1 3 24
13 13 40 16
9 9 77 68
11 1 2 137
8 5 43 153
11 10 60 93
9 4 54 124
13 11 90 62
13 11 23 10
9 5 65 152
13 10 81 159
9 5 0 100
2 1 8 10
13 4 29 108
11 9 33 62
1 1 7 0
7 6 9 117
10 7 79 17
6 3 44 136
9 1 89 169
12 12 90 59
11 11 67 48
8 2 50 165
12 3 36 39
11 2 46 157
12 7 57...

output:

102.764986357426
3.769911184308
519.130732713193
531.557476987393
7.895855251233
201.659447813743
624.135520745836
197.885993911459
1035.713284718475
252.339703253340
297.248770789876
1051.611431187917
43.633231299858
1.431169986635
178.080101488160
318.033896298407
0.488692190558
101.498343168797
4...

result:

ok 100000 numbers

Test #13:

score: 0
Accepted
time: 112ms
memory: 3640kb

input:

100000
16 6 41 45
19 4 51 119
1 1 20 49
20 20 68 30
20 20 56 133
16 6 69 27
13 12 17 12
11 6 33 146
12 9 51 156
7 7 6 125
20 17 76 123
20 13 14 80
20 20 50 160
10 9 89 177
13 4 0 61
18 4 65 36
10 5 34 167
17 15 73 74
18 1 26 107
17 8 6 65
10 5 14 130
19 6 51 73
11 1 75 177
14 3 76 96
8 3 31 9
7 5 13...

output:

374.617470648063
509.228455427212
2.251474735073
2108.357736409150
2531.274337012178
599.834757325411
215.600522498860
270.926866137203
635.711065501703
129.606175914050
2456.987219221100
502.061412628689
2584.665518016392
815.152005832541
17.034413499465
559.133679168903
211.681588457093
1595.26584...

result:

ok 100000 numbers

Test #14:

score: 0
Accepted
time: 123ms
memory: 3612kb

input:

100000
21 19 6 6
17 6 48 147
16 10 56 89
18 18 89 19
19 18 79 85
15 7 12 18
20 18 57 117
17 16 36 117
9 6 12 81
20 19 4 76
19 18 7 97
21 2 79 160
21 19 5 4
21 19 25 119
14 10 54 129
21 17 49 21
21 13 48 179
14 14 31 80
18 17 51 1
8 4 37 1
13 9 90 118
14 14 47 64
16 11 3 74
20 15 30 42
19 19 38 133
1...

output:

205.355439789653
550.064867878034
816.046145062469
2120.575041173110
2368.254715323626
116.762526958421
2110.323177930085
1215.784171253939
98.017690792002
585.034365268499
715.994457120843
741.835073303215
164.828894558344
1464.155538987371
783.297607028993
1340.849197844644
1499.375882007590
697.8...

result:

ok 100000 numbers

Test #15:

score: 0
Accepted
time: 116ms
memory: 3608kb

input:

100000
14 12 55 44
19 19 55 175
18 18 25 53
18 12 61 16
22 19 85 30
21 17 53 122
22 22 80 110
20 17 46 87
19 11 64 165
5 1 20 110
19 6 46 176
22 22 45 164
22 18 77 35
22 4 69 53
17 2 34 93
22 17 33 179
16 12 79 106
17 17 64 87
22 16 60 76
12 4 43 109
18 10 51 174
11 8 60 26
19 17 5 46
14 12 75 101
2...

output:

759.497477297852
2516.027606494228
865.194616798629
998.398145310836
2682.832859703084
1972.151629880214
3638.749115892898
1537.931776979843
1382.218152879955
14.689817208969
614.867582302068
2986.650744477979
2348.165975633171
828.891768357147
220.728142886872
1783.948886141239
1349.166583182557
17...

result:

ok 100000 numbers

Test #16:

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

input:

100000
22 20 49 129
22 1 9 42
29 27 41 134
29 29 72 80
27 16 71 123
28 7 21 71
25 13 70 133
28 11 27 60
29 28 68 3
23 5 1 168
27 22 79 16
29 10 17 81
27 15 90 119
29 28 86 79
22 21 69 122
27 27 49 139
16 8 11 97
16 11 4 58
12 11 32 128
18 8 35 146
29 22 27 19
30 15 50 115
15 2 24 72
18 6 80 158
13 6...

output:

2446.922149155350
83.828163973288
4035.070122674870
5401.584595412211
2878.481412038130
509.705954752424
2207.415857830734
843.465267611300
3897.040967023019
91.368440291689
3445.681369164765
592.661454099714
3265.055309950067
5957.681401682644
3188.830921300577
4354.967682393698
219.088323702232
17...

result:

ok 100000 numbers

Test #17:

score: 0
Accepted
time: 124ms
memory: 3640kb

input:

100000
39 35 57 118
18 2 33 138
37 28 62 114
40 2 11 130
11 9 78 113
23 17 47 122
29 7 65 143
36 27 11 77
24 19 77 38
34 30 5 12
12 2 74 14
38 31 37 82
36 34 15 85
39 27 17 161
37 15 46 80
40 14 33 54
37 30 88 95
40 22 9 111
36 36 12 52
40 40 48 151
40 39 41 163
21 16 42 73
18 2 64 146
40 37 84 152
...

output:

8021.612925242913
241.910091287406
6161.900464289473
349.647106948921
706.655863042591
1953.103910453777
1613.995982469011
1741.698967150181
2724.301882730469
545.938990023826
254.119939090374
4449.874007592223
2997.777523225460
3534.158747180425
2485.069602159606
1864.221080640183
8387.167443573259...

result:

ok 100000 numbers

Test #18:

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

input:

100000
9 8 74 2
47 41 64 61
42 1 75 10
33 29 33 75
43 1 76 103
48 12 73 90
50 50 35 160
50 48 13 179
49 46 77 169
30 18 74 55
44 43 77 164
15 2 31 91
49 43 31 120
49 36 39 131
43 8 23 142
33 31 25 74
25 6 58 129
28 20 31 95
8 7 1 148
37 10 52 156
11 5 54 52
49 26 33 2
20 17 13 33
38 23 89 34
50 7 60...

output:

375.490135274060
10439.809093851722
2420.509873128336
3314.851488435270
2570.010106911053
4812.919945299563
13536.165609610958
9417.110876737315
18693.856547754671
3286.734234185642
15787.461796313239
162.717444833826
8548.794250962402
8091.250708603430
1231.610429358239
3028.390598305441
1068.31698...

result:

ok 100000 numbers

Test #19:

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

input:

100000
985040437 963837006 74 178
562320397 456498961 21 57
616458849 43215539 12 112
967049313 962181597 55 20
404875500 323494205 16 148
822013814 350801410 65 117
493753261 325808227 72 151
883524417 55981080 1 165
756475575 306464991 75 65
982861539 971158777 53 2
977914232 494619050 34 80
92912...

output:

7823031139236863525.500000000000
587759779770854584.312500000000
95369829970997623.203125000000
3895961013788279691.000000000000
443752067877684912.125000000000
1832058841745101799.375000000000
1157411971581695252.875000000000
25211463877824919.832031250000
1585510323477645043.875000000000
356484642...

result:

ok 100000 numbers

Test #20:

score: 0
Accepted
time: 167ms
memory: 3644kb

input:

100000
915624482 436335283 31 93
966989692 899762255 14 172
971565321 859650888 86 78
840892426 595383046 16 116
992919354 525701445 9 98
924698821 417910701 18 49
923077550 641792877 68 62
918753914 850646822 29 137
935549247 897719522 87 46
937380829 805246200 55 11
434960395 174040501 0 56
902102...

output:

1298002666918420081.375000000000
3375253522633562132.250000000000
6039368287407980263.000000000000
1313133658442171531.125000000000
835838455087290147.875000000000
715665701891950373.250000000000
3352034067230078397.500000000000
3413794084111542658.250000000000
5750292420404997950.000000000000
30395...

result:

ok 100000 numbers