QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#187498#3854. RadarOUYE#AC ✓231ms5316kbC++142.8kb2023-09-24 17:49:272023-09-24 17:49:27

Judging History

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

  • [2023-09-24 17:49:27]
  • 评测
  • 测评结果:AC
  • 用时:231ms
  • 内存:5316kb
  • [2023-09-24 17:49:27]
  • 提交

answer

#include<set>
#include<map>
#include<queue>
#include<stack>
#include<cmath>
#include<bitset>
#include<vector>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
#define LL long long
#define ENDL putchar('\n')
# define rep(i,a,b) for(int i=(a); i<=(b); ++i)
# define drep(i,a,b) for(int i=(a); i>=(b); --i)
# define rep0(i,a,b) for(int i=(a); i!=(b); ++i)
inline LL readint() {
	LL f=1,x=0;int s=getchar();
	while(s<'0'||s>'9') {if(s<0)return -1;if(s=='-')f=-f;s=getchar();}
	while(s>='0'&&s<='9') {x=(x<<3)+(x<<1)+(s^48);s=getchar();}
	return f*x;
}

using LDB = long double;
# define double LDB
const int MAXN = 100005;
struct Angle{
    int x, y;
    bool operator < (const Angle &t) const {
        // if(y == 0 && x < 0) return true;
        // if(y < 0 && t.y > 0) return true;
        return atan2(y,x) < atan2(t.y,t.x);
        // if(y >= 0 && t.y <= 0) return false;
        // return 1ll*x*t.y > 1ll*y*t.x;
    }
};
int radii[MAXN]; Angle angle[MAXN];

int closer(int cntr, double x){
    int t = std::lower_bound(radii+1,radii+cntr+1,x)-radii;
    if(t == cntr+1) return radii[cntr];
    if(t == 1) return radii[1];
    if(radii[t]-x < x-radii[t-1])
        return radii[t];
    return radii[t-1]; // closer
}
double tryit(Angle ang, int x, int y, int cntr){
    double len = sqrt(1ll*ang.x*ang.x+1ll*ang.y*ang.y);
    double cox = ang.x/len, six = ang.y/len;
    double b = double(x)*cox+double(y)*six;
    double r = closer(cntr,b); // best
    // printf("angle = %.5f, r = %.5f\n",atan2(ang.y,ang.x),r);
    return (x-r*cox)*(x-r*cox)+(y-r*six)*(y-r*six);
}
int main(){
    int cntr = readint(), cntp = readint(), n = readint();
    rep(i,1,cntr) radii[i] = readint();
    std::sort(radii+1,radii+cntr+1);
    rep(i,1,cntp){
        angle[i].x = readint();
        angle[i].y = readint();
    }
    std::sort(angle+1,angle+cntp+1);
    // rep(i,1,cntp) printf("ang[%d] = %.5f\n",i,atan2(angle[i].y,angle[i].x));
    angle[0] = angle[cntp];
    angle[cntp+1] = angle[1];
    angle[cntp+2] = angle[2];
    while(n--){
        Angle arg; arg.x = readint(), arg.y = readint();
        if(arg.x == 0 && arg.y == 0){
            printf("%d\n",radii[1]);
            continue;
        }
        // printf("arg = %.5f\n",arg);
        int t = std::lower_bound(angle+1,angle+cntp+1,arg)-angle;
        double ouye = tryit(angle[t],arg.x,arg.y,cntr);
        ouye = std::min(ouye,tryit(angle[t-1],arg.x,arg.y,cntr));
        ouye = std::min(ouye,tryit(angle[t+1],arg.x,arg.y,cntr));
        if(t != 1)
            ouye = std::min(ouye,tryit(angle[t-2],arg.x,arg.y,cntr));
        else if(cntp != 1)
            ouye = std::min(ouye,tryit(angle[cntp-1],arg.x,arg.y,cntr));
        printf("%.13Lf\n",sqrt(ouye));
    }
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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.6052910729166
0.9777722904656
1.5518451054018
1.4142135623731

result:

ok 4 numbers

Test #2:

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

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.8749850992576
15.8749850992576
15.8749850992576
15.8749850992576
15.8749850992576
15.8749850992576
15.8749850992576
15.8749850992576
4.9296567010457
4.9296567010457
4.9296567010457
4.9296567010457
4.9296567010457
4.9296567010457
4.9296567010457
4.9296567010457
2.0000000000000
2.0000000000000
2.00...

result:

ok 32 numbers

Test #3:

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

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.0553851381374
4.1231056256177
3.6055512754640
11.0453610171873
15.2970585407784
1.4142135623731
8.2462112512353
7.0000000000000
8.9442719099992
3.0000000000000
12.1655250605964
5.0000000000000
5.0990195135928
11.1803398874989
1.4142135623731
2.0000000000000
2.0000000000000
3.0000000000000
3.162277...

result:

ok 1681 numbers

Test #4:

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

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.7773721193036
4.6315936825902
6.8956561009773
12.2914229053669
6.5559640035805
4.2703042060470
4.3925360004476
6.3678258857453
6.5559640035805
2.9903163793705
10.1875203594951
2.8336261665087
2.9770648313653
4.6967798601620
4.3522398886931
11.3284558097968
3.3840301477099
1.8364593657444
2.947251...

result:

ok 1681 numbers

Test #5:

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

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.0000000000000
4.0000000000000
4.0000000000000
4.0000000000000
5.0000000000000
5.0000000000000
5.0000000000000
5.0000000000000
1.0000000000000
1.0000000000000
1.0000000000000
1.0000000000000
8.0622577482985
8.0622577482985
8.0622577482985
8.0622577482985

result:

ok 16 numbers

Test #6:

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

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.0000000000000
2.0000000000000
4.0000000000000
8.0000000000000
16.0000000000000
32.0000000000000
64.0000000000000
128.0000000000000
256.0000000000000
512.0000000000000
1024.0000000000000
2048.0000000000000
4096.0000000000000
8192.0000000000000
16384.0000000000000
32768.0000000000000
65536.000000000...

result:

ok 120 numbers

Test #7:

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

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.3930715958996
16.4534412434766
14.4756400852358
19.0432313681442
16.1829324174512
19.0432313681442
19.0105765365902
3.3058935536606
11.7631876207952
14.6673083600556
16.2955256397971
7.6177055109477
16.6926529030191
25.8700576850889
16.1829321987597
20.0848704315849
10.6945116845406
19.29511600746...

result:

ok 1681 numbers

Test #8:

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

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
3.0000000000000
2.0000000000000
1.0000000000000
0.0000000000000
1.0000000000000
2.0000000000000
1.0000000000000
0.0000000000000
1.0000000000000
2.0000000000000
3.0000000000000
4.0000000000000
3.0000000000000
2.0000000000000
1.0000000000000
0.0000000000000
1.0000000000000
2.0000000000000
3.00000000...

result:

ok 108 numbers

Test #9:

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

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.2195444572929
3.1622776601684
15.0332963783729
6.7082039324994
6.0000000000000
19.1049731745428
12.0000000000000
1.0000000000000
5.6568542494924
4.1231056256177
1.4142135623731
5.0990195135928
12.3693168768530
19.2353840616713
6.0000000000000
9.4868329805051
6.3245553203368
4.1231056256177
18.0277...

result:

ok 1681 numbers

Test #10:

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

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.4142135623731
18.4390889145858
4.4721359549996
12.0415945787923
14.3178210632764
10.4403065089106
19.0262975904404
15.0332963783729
3.6055512754640
8.5440037453175
18.0277563773199
17.4642491965730
20.0000000000000
5.0000000000000
13.3416640641263
10.0498756211209
18.0277563773199
16.0000000000000...

result:

ok 1681 numbers

Test #11:

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

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.3416679655883
7.6157731058639
19.2353998816819
17.2626804447051
14.1421356237310
18.0277643729907
10.1980468796765
11.7046999107196
6.0000000000000
16.0312195418814
14.0356768352672
3.0000000000000
7.2801252890472
20.0997512422418
14.1421395874890
13.0000000000000
16.2788048544176
4.4721359549996...

result:

ok 1681 numbers

Test #12:

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

input:

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

output:

7.0710678118655

result:

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

Test #13:

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

input:

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

output:

7.0710668209260

result:

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

Test #14:

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

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.0000000000000
0.0000000000000
1.0000000000000
0.0000000000000
1.0000000000000
2.0000000000000
1.0000000000000
0.0000000000000
1.0000000000000
2.0000000000000
3.0000000000000
4.0000000000000
5.0000000000000
6.0000000000000
7.0000000000000
8.0000000000000
9.0000000000000
10.0000000000000
1.414213562...

result:

ok 36 numbers

Test #15:

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

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.3182731895074
3.1473792392236
3.0430036645565
5.6011396576375
6.2947584784471
6.5534384968573
6.0860073291131
7.4801645331180

result:

ok 8 numbers

Test #16:

score: 0
Accepted
time: 130ms
memory: 5248kb

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.9988657018687
14.5254230187611
21.0731021177943
31.8431891132411
115.9248950136157
49.9913910549399
60.5066297164416
69.9581300395858
134.9023081512422
90.1725614314229
100.2201514116682
110.1548528850700
119.8381380576503
169.2592599248305
139.8577138099724
149.9038626120958
159.8130340193177
16...

result:

ok 99999 numbers

Test #17:

score: 0
Accepted
time: 148ms
memory: 5184kb

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
15.2958413089682
21.4720815031587
30.8393085198004
35.0065552725237
50.9314581074773
60.5066198289978
70.3637954422017
80.0070389371158
90.0561713216274
100.0006332930519
110.0505082797739
119.8381280857213
129.8851979892816
134.8680764761586
149.8338746362690
159.9504696769169
169.9239989400186
...

result:

ok 99999 numbers

Test #18:

score: 0
Accepted
time: 140ms
memory: 5068kb

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
11.7935373289421
15.0068515693789
30.3168740890521
40.1139068208593
50.1409337174501
60.1755843152592
70.3637954422017
80.1255348013925
89.8563514597733
100.0006332930519
109.9551696143141
119.7672822408764
129.8121319792217
139.9326708468756
149.7138600566733
159.7536466146996
169.7387412248467
...

result:

ok 99999 numbers

Test #19:

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

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.2481144769800
1548.7281109116650
1574.0708501919478
1568.8551566096348
1558.5825781390353
1562.0147640986934
1556.5842717790730
1558.5646380075505
1566.8505481581557
1566.9485078238632
1544.5394122091673
1556.4551977838363
1555.1822322681235
1562.6999665820563
1569.1638953948193
1561.12101686...

result:

ok 1781 numbers

Test #20:

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

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.0683434492658
455444.0373052710051
455456.3066096513989
455477.3700487538563
455453.1835150376635
455440.1870622285312
455465.0307649363443
455465.7106426147033
455475.7122019027373
455459.6378850711775
455454.6035687640837
455458.9059107929985
455452.0632876442174
455464.8351371156669
455466...

result:

ok 1781 numbers

Test #21:

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

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.4744860807643
284359.7937326451717
284363.9738783134089
284349.9082260941499
284348.8135097056862
284360.5598107703062
284354.9974316169599
284364.1247453374129
284362.6800045755573
284362.4967908194882
64050.7202106845620
284352.7259971489796
284351.4009495988802
284351.0378320768803
284357....

result:

ok 1781 numbers

Test #22:

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

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.6213946430612
393120.7449036816478
393130.1893515887409
393123.0585996906924
393128.1342968973675
393119.0333790730658
393131.7164313637263
393123.2756218586501
393117.2885853861347
393128.2192260720328
393128.2976373296715
393121.1658961183345
393113.8298865792716
393115.1890569119708
393125...

result:

ok 1781 numbers

Test #23:

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

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.9354150393766
234686.7807629827576
234696.2240520968140
234689.2346241891706
234681.5098335412538
234688.3252222843875
234690.9855304209247
234685.3147014687726
234697.8830629736140
234685.9833333846497
234683.3429209643812
234692.9780974650624
234686.0763946139569
234686.2402794004639
396836...

result:

ok 1781 numbers

Test #24:

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

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.4464186371559
427613.1854399750579
427604.1969378024829
427623.3689719696064
427607.1336015388935
427612.8164132330821
427615.3544984800570
427597.8536826501056
427608.7299558724444
427602.7867793378181
427604.0377032625593
427604.6121188239705
427612.1806334546548
427618.9949966860005
427621...

result:

ok 1781 numbers

Test #25:

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

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.9165168857028
4368.0758706658459
4363.0020098750008
4351.1578563697764
4369.0718215704373
4360.8101156024762
4359.4961286185138
4364.1521082320648
4372.2911649193491
4363.8084916373034
4356.8654060771913
4360.2115482110985
4362.4963441942036
4358.7648316377258
4357.2291552380398
4358.9319104596...

result:

ok 1781 numbers

Test #26:

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

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.6033254375029
730974.0822828851944
730965.4851023241062
730979.7929875460048
730970.7383913306430
731000.1404590525038
730970.3092272541267
730996.5578690479775
730961.6155512138261
730976.5908296097818
730959.8001171694293
730979.5284979128103
730970.6445485504685
730971.7443213345767
730991...

result:

ok 1781 numbers

Test #27:

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

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.2062677919336
1169879.3484745152244
372097.8061628807501
372088.1768901450558
372081.4979902456919
372081.0146697492462
372057.6218467270758
372089.5017386431726
372069.4910041816853
372077.2541804247612
372071.9262006429731
372082.7509122226451
372088.4440275509681
372062.6032399930887
37206...

result:

ok 1781 numbers

Test #28:

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

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.0737677407049
10.8584744559936
7.6493999471861
8.5049614073201
9.3845590304147
7.8328754235368
1.4426520975593
15.7342263933960
16.8663115061957
12.6079000738433
21.7919700946084
6.4775878436357
6.1759278455934
13.7882037191223
8.1751751578124
14.1638842425991
18.2579001670493
6.9483769987089
9.5...

result:

ok 1781 numbers

Test #29:

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

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.0000000000000
10.1980390271856
12.4280265578537
1330347.1497960981136
8.2358015471930
10.5097975300534
11.6667346919439
8.6023252670426
15.5673744013083
3.6055512754640
19.2093727122985
20.4463645636373
7.2111025509280
12.7413949687822
12.3847763108502
11.9693331169162
8.9319456944983
3.464101615...

result:

ok 1781 numbers

Test #30:

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

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.4040205327618
20.3889325899281
10.2195566441237
20.9253456962209
5.0441311219367
12.2480792064133
2.8754845034029
2.6885055135101
16.3486614203952
12.6472487420681
11.5333940287686
1.3633323343458
23.9644335715212
2.7242405376954
9.6147417425165
6.2938124893327
6.8351656708302
7.6906279859596
5.92...

result:

ok 1781 numbers

Test #31:

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

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.9398912450931
7.6361548371268
9.3932401728640
10.3827861810048
14.4703234697250
7.0635424691856
8.7303767022420
24.0927669494169
201368.8360759774851
5.3969058875521
9.1064450346514
17.8288155818012
24.4702371330679
17.7380017433091
11.3996845334775
13.5680832914585
18.6948690815132
19.4079600661...

result:

ok 1781 numbers

Test #32:

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

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.7145024449784
25.4360892132335
16.8762956509540
26.1641321347804
11.3666783263384
31.2000472601541
26.9566227969695
25.9342905393561
22.9876667823710
28.2227880789101
10.7490260251425
5.6990875225215
26.9307963938911
21.3365236499528
24.2120140849849
25.5749320489346
27.6895476039648
1162982.7905...

result:

ok 1781 numbers

Test #33:

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

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.1209002935440
12.2772276685029
25.7567133818304
6.9941115246094
23.9825159708021
7.0392164741618
11.8511362927733
20.9090238125652
16.7515443882808
14.3129819163066
15.1724182080657
24.9357973613575
17.0937049272580
18.6771301874069
14.7343522809868
11.4962954016784
2.5307101308434
5.175208500927...

result:

ok 1781 numbers

Test #34:

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

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.9326508695947
7.2111025509280
5.0000000000000
12.1822943163425
18.0000000000000
0.2774024237788
12.9330407734187
1024855.1362422595560
12.4191235571413
3.2557641192199
5.6638850300910
9.0978178306999
16.0561514691410
16.1269834015568
4.5388725573999
12.7787798940903
11.4611575407713
10.6996357020...

result:

ok 1781 numbers

Test #35:

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

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.5687539816840
25.1298126399251
22.0881979879481
19.7496270686792
15.3953323408734
17.1047134910538
17.1695522812937
13.3505961043958
22.1205168733409
22.1660314612382
26.0060950509531
12.7969477064587
17.0144585373997
18.1667812746999
24.4517642982944
23.1766968957423
24.9939676172689
0.992054701...

result:

ok 1781 numbers

Test #36:

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

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.2360679774998
8.7960029994319
15.6972917725327
19.4757613343876
9.0553851381374
11.3946710524048
5.0990195135928
19.0000000000000
8.6194183397274
9.1925255135323
16.6720207952907
714191.2393371960146
13.9894259105233
2.6524140374402
9.8488578017961
16.2675280123273
9.5293804174768
2.7082039324994
...

result:

ok 1781 numbers

Test #37:

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

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.9777722904656
2.7501207738952
0.8467777080054
1.4640710529237
0.5857864376269

result:

ok 5 numbers

Test #38:

score: 0
Accepted
time: 69ms
memory: 5316kb

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.4624881650358
15.7507967632961
53.6782422350506
82.3684440692789
13.9838009687247
37.9496244077921
19.4173827398814
26436.9548043145221
16.2765460520035
17.4551154638594
41.1397426182851
10.8863851268800
2.5412770185391
43.1240791922963
91.9368327379981
29490.0586455992879
25443.5386436928905
2652...

result:

ok 100 numbers

Test #39:

score: 0
Accepted
time: 210ms
memory: 4804kb

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.9722633644104
1395.0062626894922
65837.7160401329824
3799.0857826352406
3433.7582838398537
194.0906922274964
7369.2107256302517
265305.1531383888990
8568.3343021556784
4911.6507692488430
54497.5243289319023
3603.7536804998539
3575.1208188543835
159352.0178493279636
3626.6086766662952
100481.17...

result:

ok 100000 numbers

Test #40:

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

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.6361725391265
5614.8046000557031
18063.4913598158560
48666.3501369986426
29146.2021537902002
1712.9325200998176
166623.0474619099153
37945.2261243401070
14861.6897492694266
52982.2835615195599
2858.9781204075785
13281.3495404316454
2313.8172852285478
9696.1464429239381
24522.0064309631525
915.7...

result:

ok 100000 numbers

Test #41:

score: 0
Accepted
time: 149ms
memory: 5076kb

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.0000000000000
7.0000000000016
7.0000000000016
7.0000000000000
9
9
9
9
1.0076209824032
2.0000000000000
11.4017621445907
11.4017542509914
8.0063054999637
9.0000100001000
9.0000000000000
20.1246117974981
0.1107702762748
2.0000000000000
19.3132172359662
19.3132079158280
16.0126109999274
18.00002000020...

result:

ok 99999 numbers

Test #42:

score: 0
Accepted
time: 226ms
memory: 5256kb

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.8692960482550
10.5470841016828
20.3382454627823
11.0472391774452
29307.6437463290739
8.6969391828891
12.9822052411619
42.2088256856821
18.2848468366639
1.3245014228667
89248.1133292884569
10.6987302580983
12.0639242325940
82.4567908908549
0.2739294505417
4.0821021569696
229619.2954495685041
173821...

result:

ok 100000 numbers

Test #43:

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

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.6181405491792
10.7354445175342
2.7296714993439
305762.7775181702506
18.1307777902058
24.2547682094488
9.7506016302361
7.1811992373058
9.1855282106054
51.8640420520008
57.7841921802427
304131.5864052721378
91.1310961957674
21.5119422204804
5.6104899817715
13.2966428264060
149597.3100500289426
...

result:

ok 100000 numbers

Test #44:

score: 0
Accepted
time: 231ms
memory: 5184kb

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.0402331255956
17.8425845809591
17.0751145444210
11.2809525830531
219404.3062970769229
27.0776255335208
228139.7750113377247
14.1896895951989
32.1516847697497
13.9588072590085
30.4749015727239
352634.1106456191444
220634.7687600593591
67.3379724527840
65.6108846852411
7.9546469271052
8.880469192938...

result:

ok 100000 numbers