QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#187129#3854. RadarDuckDebuggian#AC ✓224ms7460kbC++141.9kb2023-09-24 14:48:152023-09-24 14:48:16

Judging History

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

  • [2023-09-24 14:48:16]
  • 评测
  • 测评结果:AC
  • 用时:224ms
  • 内存:7460kb
  • [2023-09-24 14:48:15]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define N 100005
int n, m, q;
struct Point
{
    double x, y;
    Point(){}
    Point(double _x, double _y)
    {
        x = _x, y = _y;
    }
    Point operator + (Point p){return Point(x + p.x, y + p.y);}
    Point operator - (Point p){return Point(x - p.x, y - p.y);}
    Point operator * (double c){return Point(x * c, y * c);}
    Point operator / (double c){return Point(x / c, y / c);}
}A[N], tmp;
double R[N], G[N];
double Dis(Point a)
{
    return sqrt(a.x * a.x + a.y * a.y);
}
bool cmp(Point a, Point b)
{
    return atan2(a.y, a.x) < atan2(b.y, b.x);
}
double Getans(int v)
{
    int l = 1, r = n;
    double ans = 1e20;
    while (l < r)
    {
        int mid = (l + r) >> 1;
        Point a = A[v] * R[mid], b = A[v] * R[mid + 1];
        ans = min(ans, Dis(a - tmp));
        ans = min(ans, Dis(b - tmp));
        if (Dis(a - tmp) < Dis(b - tmp))
            r = mid;
        else
            l = mid + 1;
    }
        Point a = A[v] * R[l], b = A[v] * R[r];
           ans = min(ans, Dis(a - tmp));
        ans = min(ans, Dis(b - tmp));
    return ans;
}
int main()
{
    scanf("%d%d%d", &n, &m, &q);
    for (int i = 1; i <= n; i++)
        scanf("%lf", &R[i]);
    sort(R + 1, R + n + 1);
    for (int i = 1; i <= m; i++)
    {
        scanf("%lf%lf", &A[i].x, &A[i].y);
        A[i] = A[i] / Dis(A[i]);
    }
    sort(A + 1, A + m + 1, cmp);
    A[m + 1] = A[1];
    A[0] = A[m];
    for (int i = 1; i <= m; i++)
        G[i] = atan2(A[i].y, A[i].x);
    for (int i = 1; i <= q; i++)
    {
        int a, b;
        scanf("%d%d", &a, &b);
        if (a == 0 && b == 0)
        {
            printf("%.10lf\n", R[1]);
            continue;
        }
        tmp = Point(a, b);
        int v = lower_bound(G + 1, G + m + 1, atan2(tmp.y, tmp.x)) - G;
        double ans = min(Getans(v), Getans(v - 1));
        printf("%.10lf\n", ans);
    }
}

詳細信息

Test #1:

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

input:

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

output:

0.6052910729
0.9777722905
1.5518451054
1.4142135624

result:

ok 4 numbers

Test #2:

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

input:

1 8 32
7
0 1
1 0
0 -1
-1 0
1 -1
-1 1
-1 -1
1 1
20 10
10 20
-20 10
10 -20
-10 20
20 -10
-10 -20
-20 -10
2 1
1 2
-2 1
1 -2
-1 2
2 -1
-1 -2
-2 -1
5 0
0 5
-5 0
0 -5
5 5
5 -5
-5 5
-5 -5
9 0
0 9
-9 0
0 -9
9 9
9 -9
-9 9
-9 -9

output:

15.8749850993
15.8749850993
15.8749850993
15.8749850993
15.8749850993
15.8749850993
15.8749850993
15.8749850993
4.9296567010
4.9296567010
4.9296567010
4.9296567010
4.9296567010
4.9296567010
4.9296567010
4.9296567010
2.0000000000
2.0000000000
2.0000000000
2.0000000000
0.0710678119
0.0710678119
0.0710...

result:

ok 32 numbers

Test #3:

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

input:

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

output:

9.0553851381
4.1231056256
3.6055512755
11.0453610172
15.2970585408
1.4142135624
8.2462112512
7.0000000000
8.9442719100
3.0000000000
12.1655250606
5.0000000000
5.0990195136
11.1803398875
1.4142135624
2.0000000000
2.0000000000
3.0000000000
3.1622776602
8.2462112512
4.4721359550
5.0000000000
8.54400374...

result:

ok 1681 numbers

Test #4:

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

input:

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

output:

11.7773721193
4.6315936826
6.8956561010
12.2914229054
6.5559640036
4.2703042060
4.3925360004
6.3678258857
6.5559640036
2.9903163794
10.1875203595
2.8336261665
2.9770648314
4.6967798602
4.3522398887
11.3284558098
3.3840301477
1.8364593657
2.9472515164
7.6351318958
9.0921846698
8.0269747761
5.72755681...

result:

ok 1681 numbers

Test #5:

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

input:

1 4 16
7
0 1
1 0
0 -1
-1 0
3 0
0 3
-3 0
0 -3
3 3
3 -3
-3 3
-3 -3
8 0
0 8
-8 0
0 -8
8 8
8 -8
-8 8
-8 -8

output:

4.0000000000
4.0000000000
4.0000000000
4.0000000000
5.0000000000
5.0000000000
5.0000000000
5.0000000000
1.0000000000
1.0000000000
1.0000000000
1.0000000000
8.0622577483
8.0622577483
8.0622577483
8.0622577483

result:

ok 16 numbers

Test #6:

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

input:

30 4 120
128
1
2
256
4
512
1024
2048
8
4096
32768
131072
262144
524288
8192
268167
16
536334
16384
1047
32
2095
8380
64
134083
65536
4190
67041
33520
16760
536334 0
-536335 0
0 536334
0 -536335
-1 1
-2 2
-4 4
-8 8
-16 16
-32 32
-64 64
-128 128
-256 256
-512 512
-1024 1024
-2048 2048
-4096 4096
-8192...

output:

1.0000000000
2.0000000000
4.0000000000
8.0000000000
16.0000000000
32.0000000000
64.0000000000
128.0000000000
256.0000000000
512.0000000000
1024.0000000000
2048.0000000000
4096.0000000000
8192.0000000000
16384.0000000000
32768.0000000000
65536.0000000000
131072.0000000000
262144.0000000000
524288.000...

result:

ok 120 numbers

Test #7:

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

input:

4 4 1681
1000
1
999000
999
999000 999000
-999001 999000
999000 -999001
-999001 -999001
9 2
-17 -3
15 3
-19 -6
-6 -16
19 6
-12 -16
1 4
4 12
4 -15
-1 -17
5 7
12 13
19 -19
6 -16
-9 -19
6 -10
1 -20
18 17
-2 -20
13 -13
2 -7
13 14
-15 -7
7 -2
-3 4
-15 11
13 -15
20 -20
13 5
14 -5
13 11
20 0
-4 18
-2 -2
-18...

output:

8.3930715959
16.4534412435
14.4756400852
19.0432313681
16.1829324175
19.0432313681
19.0105765366
3.3058935537
11.7631876208
14.6673083601
16.2955256398
7.6177055109
16.6926529030
25.8700576851
16.1829321988
20.0848704316
10.6945116845
19.2951160075
23.7592618849
19.3361656392
17.3847763109
6.4243345...

result:

ok 1681 numbers

Test #8:

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

input:

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

output:

4.0000000000
3.0000000000
2.0000000000
1.0000000000
0.0000000000
1.0000000000
2.0000000000
1.0000000000
0.0000000000
1.0000000000
2.0000000000
3.0000000000
4.0000000000
3.0000000000
2.0000000000
1.0000000000
0.0000000000
1.0000000000
2.0000000000
3.0000000000
4.0000000000
3.0000000000
2.0000000000
1...

result:

ok 108 numbers

Test #9:

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

input:

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

output:

9.2195444573
3.1622776602
15.0332963784
6.7082039325
6.0000000000
19.1049731745
12.0000000000
1.0000000000
5.6568542495
4.1231056256
1.4142135624
5.0990195136
12.3693168769
19.2353840617
6.0000000000
9.4868329805
6.3245553203
4.1231056256
18.0277563773
4.4721359550
13.3416640641
2.2360679775
13.1529...

result:

ok 1681 numbers

Test #10:

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

input:

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

output:

1.4142135624
18.4390889146
4.4721359550
12.0415945788
14.3178210633
10.4403065089
19.0262975904
15.0332963784
3.6055512755
8.5440037453
18.0277563773
17.4642491966
20.0000000000
5.0000000000
13.3416640641
10.0498756211
18.0277563773
16.0000000000
1.4142135624
19.1049731745
17.0000000000
12.165525060...

result:

ok 1681 numbers

Test #11:

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

input:

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

output:

13.3416679656
7.6157731059
19.2353998817
17.2626804447
14.1421356237
18.0277643730
10.1980468797
11.7046999107
6.0000000000
16.0312195419
14.0356768353
3.0000000000
7.2801252890
20.0997512422
14.1421395875
13.0000000000
16.2788048544
4.4721359550
8.9442719100
5.0000000000
2.0000000000
18.2482875909
...

result:

ok 1681 numbers

Test #12:

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

input:

3 2 1
1
2
4
0 1
0 -1
-7 0

output:

7.0710678119

result:

ok found '7.0710678', expected '7.0710678', error '0.0000000'

Test #13:

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

input:

3 2 1
1
2
4
0 1
-1 -999001
-7 0

output:

7.0710668209

result:

ok found '7.0710668', expected '7.0710668', error '0.0000000'

Test #14:

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

input:

4 1 36
8
1
2
4
0 1
0 1
0 2
0 3
0 4
0 5
0 6
0 7
0 8
0 9
0 -1
0 -2
0 -3
0 -4
0 -5
0 -6
0 -7
0 -8
0 -9
-1 0
-2 0
-3 0
-4 0
-5 0
-6 0
-7 0
-8 0
-9 0
1 0
2 0
3 0
4 0
5 0
6 0
7 0
8 0
9 0

output:

0.0000000000
0.0000000000
1.0000000000
0.0000000000
1.0000000000
2.0000000000
1.0000000000
0.0000000000
1.0000000000
2.0000000000
3.0000000000
4.0000000000
5.0000000000
6.0000000000
7.0000000000
8.0000000000
9.0000000000
10.0000000000
1.4142135624
2.2360679775
3.1622776602
4.1231056256
5.0990195136
...

result:

ok 36 numbers

Test #15:

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

input:

4 5 8
8
1
2
4
0 1
1 1
1 -1
-3 2
-2 -5
-4 0
-4 -1
-4 -2
-8 -1
-8 -2
-8 -3
-8 -4
-9 -3

output:

2.3182731895
3.1473792392
3.0430036646
5.6011396576
6.2947584784
6.5534384969
6.0860073291
7.4801645331

result:

ok 8 numbers

Test #16:

score: 0
Accepted
time: 132ms
memory: 7260kb

input:

99999 99999 99999
10
20
30
40
50
60
70
80
90
100
110
120
130
140
150
160
170
180
190
200
210
220
230
240
250
260
270
280
290
300
310
320
330
340
350
360
370
380
390
400
410
420
430
440
450
460
470
480
490
500
510
520
530
540
550
560
570
580
590
600
610
620
630
640
650
660
670
680
690
700
710
720
730...

output:

10.9988657019
14.5254230188
21.0731021178
31.8431891132
115.9248950136
49.9913910549
60.5066297164
69.9581300396
134.9023081512
90.1725614314
100.2201514117
110.1548528851
119.8381380577
169.2592599248
139.8577138100
149.9038626121
159.8130340193
169.9240089130
209.9970509223
189.7136510355
199.6229...

result:

ok 99999 numbers

Test #17:

score: 0
Accepted
time: 151ms
memory: 7400kb

input:

99999 99999 99999
10
20
30
40
50
60
70
80
90
100
110
120
130
140
150
160
170
180
190
200
210
220
230
240
250
260
270
280
290
300
310
320
330
340
350
360
370
380
390
400
410
420
430
440
450
460
470
480
490
500
510
520
530
540
550
560
570
580
590
600
610
620
630
640
650
660
670
680
690
700
710
720
730...

output:

10.0000000000
15.2958413090
21.4720815032
30.8393085198
35.0065552725
50.9314581075
60.5066198290
70.3637954422
80.0070389371
90.0561713216
100.0006332931
110.0505082798
119.8381280857
129.8851979893
134.8680764762
149.8338746363
159.9504696769
169.9239989400
174.7854552073
189.6294162543
199.660469...

result:

ok 99999 numbers

Test #18:

score: 0
Accepted
time: 138ms
memory: 7460kb

input:

99999 99999 99999
10
20
30
40
50
60
70
80
90
100
110
120
130
140
150
160
170
180
190
200
210
220
230
240
250
260
270
280
290
300
310
320
330
340
350
360
370
380
390
400
410
420
430
440
450
460
470
480
490
500
510
520
530
540
550
560
570
580
590
600
610
620
630
640
650
660
670
680
690
700
710
720
730...

output:

10.0000000000
11.7935373289
15.0068515694
30.3168740891
40.1139068209
50.1409337175
60.1755843153
70.3637954422
80.1255348014
89.8563514598
100.0006332931
109.9551696143
119.7672822409
129.8121319792
139.9326708469
149.7138600567
159.7536466147
169.7387412248
179.9004671524
189.8189023776
194.756858...

result:

ok 99999 numbers

Test #19:

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

input:

3 3 1781
27448
700036
1565
727561 561893
946824 -149222
20811 -112456
-864128 96532
16 -3
-17 6
-20 20
-13 -9
3 1
6 6
-18 -10
-10 0
-4 2
19 -11
-3 18
9 -6
-14 -5
-17 1
-16 -7
20 6
20 10
0 -8
-15 20
-12 17
-8 -13
14 -8
-14 -4
20 -12
-11 0
-7 13
1 -4
-1 17
20 4
-17 12
-3 -4
8 3
-9 -9
-11 14
-12 14
-13...

output:

869958.2481144770
1548.7281109117
1574.0708501919
1568.8551566096
1558.5825781390
1562.0147640987
1556.5842717791
1558.5646380076
1566.8505481582
1566.9485078239
1544.5394122092
1556.4551977838
1555.1822322681
1562.6999665821
1569.1638953948
1561.1210168603
1545.5216800952
1543.0646818166
1557.13424...

result:

ok 1781 numbers

Test #20:

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

input:

2 2 1781
455464
989237
648422 -984508
-86934 -353141
15 -8
12 -16
-20 -3
-5 15
6 -9
19 -16
-16 5
6 6
3 16
-2 -4
-19 -5
-1 -5
5 -11
0 1
9 9
5 13
3 -15
10 -17
16 -20
2 15
9 -2
0 5
18 -6
-20 18
3 -8
-7 -2
13 -8
15 -13
885672 69814
893942 -786043
13 1
2 7
15 20
-12 -2
679345 587036
-20 8
-9 -9
0 17
15 -...

output:

455449.0683434493
455444.0373052710
455456.3066096514
455477.3700487538
455453.1835150376
455440.1870622285
455465.0307649364
455465.7106426147
455475.7122019028
455459.6378850711
455454.6035687641
455458.9059107930
455452.0632876442
455464.8351371157
455466.5660207926
455472.1067074156
455449.82285...

result:

ok 1781 numbers

Test #21:

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

input:

4 4 1781
284368
639066
544427
453079
-473316 -385890
-403701 -456998
341400 289506
328542 749626
-11 0
15 -5
18 -15
4 18
-12 -15
-2 9
3 -20
-5 0
-5 8
14 -8
-247884 -376851
-14 -7
-2 19
18 5
4 -17
-17 10
-5 14
7 -6
4 0
13 -14
6 7
-17 19
2 20
-17 2
-18 -6
-14 -13
-2 17
16 -9
8 -13
12 5
850219 294605
2...

output:

284359.4744860808
284359.7937326452
284363.9738783134
284349.9082260942
284348.8135097057
284360.5598107703
284354.9974316170
284364.1247453374
284362.6800045755
284362.4967908195
64050.7202106845
284352.7259971490
284351.4009495989
284351.0378320769
284357.9077917042
284361.1436204024
284357.184700...

result:

ok 1781 numbers

Test #22:

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

input:

5 5 1781
855105
811761
393138
763609
395482
485837 -963055
-805058 420348
-996068 26540
957233 158478
40565 268210
19 -11
16 9
-8 -7
-15 -2
10 0
-19 -1
-5 4
-14 5
20 6
-10 -16
10 -1
-17 -6
16 -19
11 -20
-11 -20
7 -5
9 -16
7 -10
388718 -210265
-7 -12
1 6
-4 -7
-11 15
-4 -11
5 16
-1 -17
-15 9
-2 1
17 ...

output:

393119.6213946430
393120.7449036817
393130.1893515888
393123.0585996907
393128.1342968974
393119.0333790731
393131.7164313638
393123.2756218587
393117.2885853861
393128.2192260720
393128.2976373297
393121.1658961183
393113.8298865792
393115.1890569119
393125.0984592562
393130.3830549301
393119.66116...

result:

ok 1781 numbers

Test #23:

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

input:

4 4 1781
360226
923659
843797
234702
385835 56098
-255808 -788591
-223435 302545
-943925 -181801
-1 -5
0 -16
7 -8
-13 0
-14 -17
0 17
-5 10
-14 -13
-4 -1
-14 -12
-19 0
-3 9
19 -20
-11 -13
746464 508236
-244133 857457
-9 -18
0 -6
8 12
-15 -18
-552127 -210744
-7 -1
-7 13
13 -18
-16 -18
3 10
8 11
2 0
18...

output:

234696.9354150394
234686.7807629827
234696.2240520968
234689.2346241892
234681.5098335413
234688.3252222844
234690.9855304209
234685.3147014688
234697.8830629736
234685.9833333846
234683.3429209644
234692.9780974651
234686.0763946140
234686.2402794005
396836.1149253020
313138.0978605789
234682.10129...

result:

ok 1781 numbers

Test #24:

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

input:

2 2 1781
724290
427620
585285 -84915
-522957 846042
2 -4
5 -13
18 14
-5 -11
-18 4
9 12
6 9
-13 18
14 18
-2 19
17 6
17 10
5 -20
0 -7
-3 -7
-3 20
-7 11
-11 -14
7 -8
17 -5
-8 -19
-6 13
17 15
5 12
4 -18
-2 11
0 12
0 1
3 -8
11 6
-8 19
-10 11
-15 -8
-6 -18
20 -18
16 -16
16 2
-19 -10
-13 -12
-2 14
5 -18
-2...

output:

427617.4464186372
427613.1854399751
427604.1969378025
427623.3689719696
427607.1336015389
427612.8164132331
427615.3544984801
427597.8536826501
427608.7299558725
427602.7867793378
427604.0377032625
427604.6121188240
427612.1806334546
427618.9949966860
427621.9639200572
427601.4103706034
427606.96271...

result:

ok 1781 numbers

Test #25:

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

input:

4 4 1781
509841
4372
912999
543071
445967 -716460
-693896 -395076
-734650 644244
-86759 -207195
-14 -17
1 -4
9 -5
-20 -7
12 4
0 17
0 19
2 -8
10 11
-10 1
-14 -6
-13 -1
-3 11
-8 -11
-10 11
-13 5
4 -14
-977857 62664
-16 0
5 -11
-19 -7
-1 -11
9 -11
-20 13
-1 8
-2 5
10 19
19 0
20 -9
-20 -20
6 -2
17 -6
-5...

output:

4350.9165168857
4368.0758706658
4363.0020098750
4351.1578563698
4369.0718215704
4360.8101156025
4359.4961286185
4364.1521082321
4372.2911649193
4363.8084916373
4356.8654060772
4360.2115482111
4362.4963441942
4358.7648316377
4357.2291552380
4358.9319104596
4358.0025208990
546468.2508399595
4358.10292...

result:

ok 1781 numbers

Test #26:

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

input:

1 1 1781
730978
522802 -441174
-7 19
-5 -12
13 -4
12 17
-4 -16
-18 13
5 -6
-15 11
13 -10
1 -1
12 -14
-2 0
13 4
20 14
-3 18
-6 1
873868 299053
-13 7
-14 -5
5 20
12 4
-6 -4
-12 14
-1 -10
-9 10
-13 -12
-18 6
11 -4
13 13
11 14
-3 16
14 -4
13 0
14 19
-18 4
4 -19
19 -16
-6 11
-20 17
-3 13
-10 8
857606 -57...

output:

730995.6033254374
730974.0822828851
730965.4851023240
730979.7929875460
730970.7383913306
731000.1404590524
730970.3092272541
730996.5578690480
730961.6155512139
730976.5908296098
730959.8001171694
730979.5284979128
730970.6445485505
730971.7443213345
730991.9014369809
730983.2304189327
832464.81883...

result:

ok 1781 numbers

Test #27:

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

input:

1 1 1781
372082
-541795 -869565
281973 459007
739644 385456
1 18
-14 16
-17 10
19 -13
-14 -20
19 -3
-6 -11
-17 5
-3 -10
-5 4
17 -3
-11 -16
-7 -19
-11 14
-8 5
8 0
-1 -3
11 -12
-9 13
-2 11
-11 -11
12 20
-9 -20
-12 -11
541236 905488
19 16
-9 -14
9 12
-18 17
3 20
16 8
-15 14
-20 17
-4 -4
14 -1
1 -2
-17 ...

output:

910776.2062677919
1169879.3484745151
372097.8061628807
372088.1768901451
372081.4979902457
372081.0146697492
372057.6218467270
372089.5017386432
372069.4910041817
372077.2541804247
372071.9262006429
372082.7509122227
372088.4440275510
372062.6032399931
372062.1723224812
372088.0656901606
372082.0132...

result:

ok 1781 numbers

Test #28:

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

input:

4 4 1781
8
4
5
6
-7 -2
5 10
1 5
-5 3
14 -16
-17 8
10 3
10 1
-17 -1
-7 -10
-8 5
-20 -12
20 11
16 5
7 -20
10 8
-3 12
17 4
1 16
2 -14
10 -13
-4 12
-4 -11
-11 2
1 -13
-5 -11
9 -20
1 15
5 15
-11 13
2 4
-19 2
10 12
-12 8
19 -1
-14 0
-5 6
2 -1
0 13
-5 -2
-9 8
11 9
-2 -15
-4 -8
0 0
-13 -8
-5 -20
64289 -8949...

output:

23.0737677407
10.8584744560
7.6493999472
8.5049614073
9.3845590304
7.8328754235
1.4426520976
15.7342263934
16.8663115062
12.6079000738
21.7919700946
6.4775878436
6.1759278456
13.7882037191
8.1751751578
14.1638842426
18.2579001670
6.9483769987
9.5175449372
4.6494495267
12.8499491937
9.2047360461
22.8...

result:

ok 1781 numbers

Test #29:

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

input:

2 2 1781
2
6
9 9
4 0
-6 -15
16 -2
-11 2
-955131 926039
-6 5
-9 0
-10 -1
13 -5
-10 12
0 -3
-13 -12
-18 -5
-2 -6
-8 10
13 13
2 16
13 6
-2 2
9 -8
-397859 -12783
-6 14
-7 -8
-1 15
-20 7
-16 -14
54141 265024
15 -19
-18 7
-3 14
-4 16
7 10
-15 15
19 5
0 5
-1 -5
-20 -15
-5 6
10 -19
-7 7
-17 7
19 -15
17 14
3...

output:

17.0000000000
10.1980390272
12.4280265579
1330347.1497960982
8.2358015472
10.5097975301
11.6667346919
8.6023252670
15.5673744013
3.6055512755
19.2093727123
20.4463645636
7.2111025509
12.7413949688
12.3847763109
11.9693331169
8.9319456945
3.4641016151
8.5440037453
398065.7614577915
14.1462980672
12.0...

result:

ok 1781 numbers

Test #30:

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

input:

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

output:

5.4040205328
20.3889325899
10.2195566441
20.9253456962
5.0441311219
12.2480792064
2.8754845034
2.6885055135
16.3486614204
12.6472487421
11.5333940288
1.3633323343
23.9644335715
2.7242405377
9.6147417425
6.2938124893
6.8351656708
7.6906279860
5.9293364500
7.3581228982
5.5494145686
3.0717020375
19.269...

result:

ok 1781 numbers

Test #31:

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

input:

1 1 1781
3
9 5
-8 -13
-5 1
12 2
12 -3
2 -13
-4 -1
11 -1
-18 -11
-160154 122064
8 1
6 -7
-1 -16
-19 -10
0 19
-6 -6
8 -11
5 20
-9 17
-12 11
-7 8
-16 5
-6 4
4 -9
-12 17
1 11
-8 15
2 6
10 17
-19 -15
4 17
-16 11
16 -17
-4 7
-20 11
-14 7
-8 -20
15 17
-7 16
338371 -987896
75680 -112362
-7 20
-17 1
3 20
-3 ...

output:

17.9398912451
7.6361548371
9.3932401729
10.3827861810
14.4703234697
7.0635424692
8.7303767022
24.0927669494
201368.8360759775
5.3969058876
9.1064450347
17.8288155818
24.4702371331
17.7380017433
11.3996845335
13.5680832915
18.6948690815
19.4079600662
17.4610105785
11.6363114818
18.9565242218
8.989673...

result:

ok 1781 numbers

Test #32:

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

input:

1 1 1781
10
-8 7
5 1
2 -17
-14 -9
-13 -19
-18 11
14 -16
12 -12
18 2
15 2
-17 -20
-18 9
-13 5
18 -2
11 -4
-13 -17
18 5
13 -12
868693 773239
-17 -8
-10 18
-1 2
5 -2
-4 0
17 -19
-8 -7
-4 -4
197365 28813
-1 17
5 5
-18 10
-8 19
-13 -7
14 9
-7 5
7 -16
14 14
17 18
-7 1
6 -12
18 18
-8 -6
16 -20
-4 -10
-5 1
...

output:

13.7145024450
25.4360892132
16.8762956510
26.1641321348
11.3666783263
31.2000472602
26.9566227970
25.9342905394
22.9876667824
28.2227880789
10.7490260251
5.6990875225
26.9307963939
21.3365236500
24.2120140850
25.5749320489
27.6895476040
1162982.7905017526
17.3920861618
11.6800257802
7.9754800352
15....

result:

ok 1781 numbers

Test #33:

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

input:

1 1 1781
2
3 -8
-17 2
-5 9
19 -20
2 5
-15 -20
-5 -6
-11 0
-17 -13
17 2
3 -16
12 -12
17 17
13 10
12 13
-10 -12
12 -4
-1 0
0 -7
-8 -13
13 5
-20 14
8 -20
-14 1
-7 7
11 -18
18 -10
-15 -6
15 12
15 -17
10 11
-153064 -395673
19 -5
-10 13
3 5
-4 11
5 -12
2 15
-15 -15
-13 18
720298 994936
9 0
2 -15
-1 -17
13...

output:

18.1209002935
12.2772276685
25.7567133818
6.9941115246
23.9825159708
7.0392164742
11.8511362928
20.9090238126
16.7515443883
14.3129819163
15.1724182081
24.9357973614
17.0937049273
18.6771301874
14.7343522810
11.4962954017
2.5307101308
5.1752085009
14.1261046611
14.0878729618
26.0868608551
19.5411799...

result:

ok 1781 numbers

Test #34:

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

input:

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

output:

11.9326508696
7.2111025509
5.0000000000
12.1822943163
18.0000000000
0.2774024238
12.9330407734
1024855.1362422595
12.4191235571
3.2557641192
5.6638850301
9.0978178307
16.0561514691
16.1269834016
4.5388725574
12.7787798941
11.4611575408
10.6996357021
4.1231056256
18.5742670448
11.9079805173
0.7262987...

result:

ok 1781 numbers

Test #35:

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

input:

1 1 1781
3
7 -6
-1 -12
-13 18
-13 14
18 10
13 -13
0 15
5 15
15 -6
-19 -8
-18 7
-19 13
-9 -8
-14 3
-4 -19
-19 -14
19 -18
-16 -19
2 -1
17 18
10 -18
15 9
-750503 54264
4 -19
-4 -16
4 -20
-7 -6
16 4
-14 -14
6 10
2 -17
-18 -20
-10 -5
9 13
16 14
15 -18
-9 -6
12 3
-15 20
-16 7
-13 -4
6 17
-6 3
10 -1
-20 -1...

output:

10.5687539817
25.1298126399
22.0881979879
19.7496270687
15.3953323409
17.1047134911
17.1695522813
13.3505961044
22.1205168733
22.1660314612
26.0060950510
12.7969477065
17.0144585374
18.1667812747
24.4517642983
23.1766968957
24.9939676173
0.9920547016
24.7959935250
17.8089622248
16.7871867790
752464....

result:

ok 1781 numbers

Test #36:

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

input:

3 3 1781
1
5
6
1 0
2 4
-10 10
0 -2
1 14
12 18
19 16
2 -9
-15 8
0 -5
1 -19
-12 8
-10 -3
-12 19
390267 -598135
15 12
3 8
10 -9
-16 -7
-8 13
0 6
-10 4
-2 20
-12 9
-3 6
-158495 -417843
-14 -15
-14 17
-3 10
11 4
-18 14
-20 16
1 -18
13 -17
8 5
-6 -19
4 0
-953821 -473693
15 10
-7 -10
18 8
-7 -3
6 15
4 -6
1...

output:

2.2360679775
8.7960029994
15.6972917725
19.4757613344
9.0553851381
11.3946710524
5.0990195136
19.0000000000
8.6194183397
9.1925255135
16.6720207953
714191.2393371960
13.9894259105
2.6524140374
9.8488578018
16.2675280123
9.5293804175
2.7082039325
5.7624700225
15.3645891729
9.0999500626
2.1523168056
4...

result:

ok 1781 numbers

Test #37:

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

input:

3 7 5
2
4
7
8 4
2 8
-1 5
-7 2
-4 -4
1 -8
6 -3
3 -1
8 1
2 6
-5 2
-1 -1

output:

0.9777722905
2.7501207739
0.8467777080
1.4640710529
0.5857864376

result:

ok 5 numbers

Test #38:

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

input:

99996 100000 100
524288
524290
262146
524291
786444
262156
262160
262169
262170
524314
786460
524317
786463
786464
786465
786473
262192
262195
262196
524341
524343
524347
786493
524351
524352
524354
524358
786504
262218
524363
786510
262227
524374
262234
262237
786526
524385
786531
262243
262244
262...

output:

6.4624881650
15.7507967633
53.6782422350
82.3684440693
13.9838009687
37.9496244078
19.4173827399
26436.9548043145
16.2765460520
17.4551154639
41.1397426183
10.8863851268
2.5412770186
43.1240791923
91.9368327380
29490.0586455992
25443.5386436930
26521.9175358133
25.7034959278
22.2098822176
21.2293296...

result:

ok 100 numbers

Test #39:

score: 0
Accepted
time: 183ms
memory: 6580kb

input:

100 100000 100000
519684
153097
817673
204302
50193
548881
600598
61977
360473
18978
943676
632382
60487
846418
325716
742485
16470
330336
240737
978021
385642
786539
871532
153708
561268
22644
795771
122496
468609
60545
617602
768142
385680
370839
482970
101019
67740
237725
915618
576686
501937
630...

output:

88245.9722633644
1395.0062626894
65837.7160401330
3799.0857826352
3433.7582838398
194.0906922275
7369.2107256302
265305.1531383890
8568.3343021557
4911.6507692489
54497.5243289320
3603.7536804998
3575.1208188543
159352.0178493280
3626.6086766662
100481.1788710088
74738.6123827259
2868.2391253140
334...

result:

ok 100000 numbers

Test #40:

score: 0
Accepted
time: 95ms
memory: 6660kb

input:

99996 100 100000
262144
262145
262148
262156
786446
262163
262170
262171
524318
786463
262175
262176
524322
524323
524335
262193
262198
524343
262200
524352
786508
262220
786509
786516
524375
524378
262237
262238
262240
786528
786529
786530
524388
262245
786542
786546
262259
786548
262265
524410
524...

output:

5994.6361725391
5614.8046000557
18063.4913598159
48666.3501369986
29146.2021537902
1712.9325200999
166623.0474619100
37945.2261243401
14861.6897492694
52982.2835615196
2858.9781204076
13281.3495404316
2313.8172852286
9696.1464429239
24522.0064309631
915.7552648910
11130.9887613381
94958.5563657626
1...

result:

ok 100000 numbers

Test #41:

score: 0
Accepted
time: 143ms
memory: 7360kb

input:

100000 100000 99999
786438
524295
262152
9
786447
524304
262161
18
786456
524313
262170
27
786465
524322
262179
36
786474
524331
262188
45
786483
524340
262197
54
786492
524349
262206
63
786501
524358
262215
72
786510
524367
262224
81
786519
524376
262233
90
786528
524385
262242
99
786537
524394
262...

output:

7.0000000000
7.0000000000
7.0000000000
7.0000000000
9.0000000000
9.0000000000
9.0000000000
9.0000000000
1.0076209824
2.0000000000
11.4017621446
11.4017542510
8.0063055000
9.0000100001
9.0000000000
20.1246117975
0.1107702763
2.0000000000
19.3132172360
19.3132079158
16.0126109999
18.0000200002
18.0000...

result:

ok 99999 numbers

Test #42:

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

input:

95165 100000 100000
524289
524290
3
524291
5
524297
786442
524300
786447
262161
524325
41
786474
43
524340
262201
524347
524351
524352
68
786502
786505
75
262228
262230
89
262233
91
92
524382
95
786530
262250
109
524401
113
786547
114
262261
786550
262267
123
262271
127
524420
786565
524421
524424
2...

output:

4.8692960483
10.5470841017
20.3382454628
11.0472391775
29307.6437463290
8.6969391829
12.9822052411
42.2088256857
18.2848468367
1.3245014229
89248.1133292884
10.6987302581
12.0639242326
82.4567908908
0.2739294505
4.0821021570
229619.2954495685
173821.0183076296
20.9161454150
1.8833005847
23.055221488...

result:

ok 100000 numbers

Test #43:

score: 0
Accepted
time: 211ms
memory: 7444kb

input:

95136 100000 100000
786432
524296
262156
524313
786458
262171
31
262178
38
262184
524332
524333
262197
262203
524348
786494
524350
262208
65
524359
262215
262217
524363
786515
524377
786524
96
97
262243
524389
524392
104
786538
107
786539
524396
110
117
262264
121
786559
128
262274
131
524422
262279...

output:

276808.6181405492
10.7354445175
2.7296714993
305762.7775181703
18.1307777902
24.2547682094
9.7506016302
7.1811992373
9.1855282106
51.8640420520
57.7841921803
304131.5864052722
91.1310961958
21.5119422205
5.6104899818
13.2966428264
149597.3100500289
6.0074650057
13.3789594896
6.6088201420
16.79270404...

result:

ok 100000 numbers

Test #44:

score: 0
Accepted
time: 224ms
memory: 7432kb

input:

95116 100000 100000
786432
524298
13
262159
19
21
786455
28
524322
36
37
262182
262185
786475
786479
524340
786488
524350
262209
524354
786511
262224
786512
524369
524371
80
262229
524374
524376
262233
95
524384
262241
786531
262243
524390
786536
524394
524395
106
262255
112
262257
114
117
786551
78...

output:

2.0402331257
17.8425845810
17.0751145444
11.2809525831
219404.3062970770
27.0776255335
228139.7750113378
14.1896895952
32.1516847698
13.9588072591
30.4749015727
352634.1106456193
220634.7687600594
67.3379724528
65.6108846852
7.9546469271
8.8804691929
24.5766460888
25.1576550523
10.9793633707
20.5289...

result:

ok 100000 numbers