QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#320579#3854. Radaralgotester#AC ✓143ms11860kbC++143.7kb2024-02-03 18:09:092024-02-03 18:09:09

Judging History

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

  • [2024-02-03 18:09:09]
  • 评测
  • 测评结果:AC
  • 用时:143ms
  • 内存:11860kb
  • [2024-02-03 18:09:09]
  • 提交

answer

#include "bits/stdc++.h"
using namespace std;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define RFOR(i,b,a) for (int i = (b) - 1; i >= (a); i--)
#define ITER(it,a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++)
#define FILL(a,value) memset(a, value, sizeof(a))

#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair

typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;

const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000 + 7;
const LL LINF = INF * (LL) INF;

const double EPS = 1e-7;
const int MAX = 200200;

struct point
{
    double x, y;
	int id;
    point() {}
    point(double x, double y, int id) : x(x), y(y), id(id) {};
    point operator-(const point& p)const
    {
        return point (x - p.x, y - p.y, id);
    }
    point operator+(const point& p)const
    {
        return point (x + p.x, y + p.y, id);
    }
    double operator*(const point & p) const
    {
        return x * p.y - y * p.x;
    }
    point operator*(double k) const
    {
        return point(k * x, k * y, id);
    }
    double d2() const
    {
        return x * x + y * y;
    }
    double len() const
    {
        return sqrt(d2());
    }
    bool operator==(const point & p) const
    {
        return abs(x - p.x) < EPS && abs(y - p.y) < EPS;
    }
    bool operator<(const point & p) const
    {
        if (abs(x - p.x) > EPS)return x < p.x;
        if (abs(y - p.y) > EPS)return y < p.y;
        return 0;
    }
    point rotate(double cosx, double sinx) const //ccw
    {
        double xx = x * cosx - y * sinx;
        double yy = x * sinx + y * cosx;
        return point(xx, yy, id);
    }
    point rotate(double ang) const //ccw
    {
        return rotate(cos(ang), sin(ang));
    }
    point scale(double l) const  //assuming len of vector > 0
    {
        l /= len();
        return point(l * x, l * y, id);
    }
    double dot(const point& p) const
    {
        return x * p.x + y * p.y;
    }
    double polar() const // (-PI; PI]
    {
        double ang = atan2(y, x);
        //if (ang < -EPS)ang += 2 * PI; // if need [0; 2 * PI)
        return ang;
    }
    int hp() const //halfpalne relative to X-axis
    {
        return y < -EPS || (abs(y) < EPS && x < -EPS);
    }
};

bool cmpVec(const point& a, const point& b) //sort by polar angle [0; 2*PI)
{
    if (a.hp() != b.hp())return a.hp() < b.hp();
    return a * b > EPS;
}
int sign(double x)
{
    if (abs(x) < EPS)return 0;
    return x > 0 ? 1 : -1;
}

double RES[MAX];

vector<point> v;
VI r;

double getAns(point a, point v)
{
	v = v * (1 / v.len());
	int l = 0, r = SZ(::r) - 1;
	while(r - l > 3)
	{
		int m = (r - l) / 3;
		int m1 = l + m;
		int m2 = r - m;

		point p1 = v * ::r[m1];
		point p2 = v * ::r[m2];

		double d1 = (p1 - a).len();
		double d2 = (p2 - a).len();
		if (d1 < d2) r = m2;
		else l = m1;
	}

	double res = 1e47;
	FOR (i, l, r + 1)
	{
		point p = v * ::r[i];
		double d = (p - a).len();
		res = min(res, d);
	}
	return res;
}

void solve()
{
	point lastPoint;
	FOR (i, 0, SZ(v))
	{
		if (v[i].id == -1) lastPoint = v[i];
	}

	FOR (i, 0, SZ(v))
	{
		if (v[i].id == -1) lastPoint = v[i];
		else
		{
			double cur = getAns(v[i], lastPoint);
			RES[v[i].id] = min(RES[v[i].id], cur);
		}
	}
}


int main(int argc, char* argv[])
{
	//ios::sync_with_stdio(false); cin.tie(0);

	int r, f, n;
	scanf("%d%d%d", &r, &f, &n);
	FOR (i, 0, r)
	{
		int x;
		scanf("%d", &x);
		::r.PB(x);
	}

	sort(ALL(::r));

	FOR (i, 0, f)
	{
		int x, y;
		scanf("%d%d", &x, &y);

		v.PB(point(x, y, -1));
	}
	FOR (i, 0, n)
	{
		int x, y;
		scanf("%d%d", &x, &y);
		v.PB(point(x, y, i));
		RES[i] = 1e47;
	}


	sort(ALL(v), cmpVec);
	solve();
	reverse(ALL(v));
	solve();

	FOR (i, 0, n)
	{
		printf("%.13f\n", RES[i]);
	}

}

详细

Test #1:

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

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

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

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: 1ms
memory: 4076kb

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.7773721193035
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: 0ms
memory: 3936kb

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

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

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: 0ms
memory: 3928kb

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.0000000000000
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.0000000000...

result:

ok 108 numbers

Test #9:

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

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

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

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: 0ms
memory: 3920kb

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

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

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

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: 123ms
memory: 10624kb

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.0731021177942
31.8431891132411
115.9248950136157
49.9913910549399
60.5066297164416
69.9581300395859
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: 123ms
memory: 10708kb

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

result:

ok 99999 numbers

Test #18:

score: 0
Accepted
time: 129ms
memory: 11396kb

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.0000000000000
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.7138600566734
159.7536466146996
169....

result:

ok 99999 numbers

Test #19:

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

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.2481144770281
1548.7281109116652
1574.0708501919478
1568.8551566096346
1558.5825781390356
1562.0147640986934
1556.5842717790729
1558.5646380075507
1566.8505481581560
1566.9485078238631
1544.5394122091675
1556.4551977838362
1555.1822322681235
1562.6999665820565
1569.1638953948193
1561.12101686...

result:

ok 1781 numbers

Test #20:

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

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.0683434493258
455444.0373052710202
455456.3066096514231
455477.3700487538590
455453.1835150376428
455440.1870622285060
455465.0307649363531
455465.7106426146929
455475.7122019027593
455459.6378850711626
455454.6035687641124
455458.9059107930516
455452.0632876441814
455464.8351371156750
455466...

result:

ok 1781 numbers

Test #21:

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

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.4744860808132
284359.7937326451647
284363.9738783134380
284349.9082260941505
284348.8135097057093
284360.5598107702681
284354.9974316169973
284364.1247453374090
284362.6800045755226
284362.4967908195104
64050.7202106845434
284352.7259971490130
284351.4009495988721
284351.0378320768941
284357....

result:

ok 1781 numbers

Test #22:

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

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.6213946430362
393120.7449036816834
393130.1893515887787
393123.0585996906739
393128.1342968973913
393119.0333790730801
393131.7164313636604
393123.2756218586001
393117.2885853861226
393128.2192260720185
393128.2976373296697
393121.1658961183275
393113.8298865793040
393115.1890569119714
393125...

result:

ok 1781 numbers

Test #23:

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

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.9354150393920
234686.7807629827294
234696.2240520968044
234689.2346241891501
234681.5098335412622
234688.3252222843876
234690.9855304209341
234685.3147014687711
234697.8830629736185
234685.9833333846473
234683.3429209643800
234692.9780974650639
234686.0763946139487
234686.2402794004593
396836...

result:

ok 1781 numbers

Test #24:

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

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.4464186371770
427613.1854399750591
427604.1969378024805
427623.3689719695831
427607.1336015388952
427612.8164132331149
427615.3544984800974
427597.8536826500786
427608.7299558724626
427602.7867793377955
427604.0377032625256
427604.6121188239777
427612.1806334546418
427618.9949966860004
427621...

result:

ok 1781 numbers

Test #25:

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

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.9165168857025
4368.0758706658462
4363.0020098750010
4351.1578563697767
4369.0718215704383
4360.8101156024768
4359.4961286185144
4364.1521082320651
4372.2911649193493
4363.8084916373036
4356.8654060771914
4360.2115482110985
4362.4963441942036
4358.7648316377263
4357.2291552380402
4358.9319104596...

result:

ok 1781 numbers

Test #26:

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

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.6033254375216
730974.0822828852106
730965.4851023240481
730979.7929875459522
730970.7383913306985
731000.1404590525199
730970.3092272541253
730996.5578690479742
730961.6155512138503
730976.5908296097768
730959.8001171693904
730979.5284979128046
730970.6445485504810
730971.7443213346414
730991...

result:

ok 1781 numbers

Test #27:

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

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.2062677919166
1169879.3484745151363
372097.8061628807918
372088.1768901451142
372081.4979902457562
372081.0146697493037
372057.6218467270955
372089.5017386432155
372069.4910041817348
372077.2541804248467
372071.9262006430072
372082.7509122227202
372088.4440275510424
372062.6032399931573
37206...

result:

ok 1781 numbers

Test #28:

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

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

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.1497960982379
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: 1ms
memory: 3972kb

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: 0ms
memory: 4012kb

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.8360759774805
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: 4020kb

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

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

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.1362422595266
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: 4060kb

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

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.2393371959915
13.9894259105233
2.6524140374402
9.8488578017961
16.2675280123273
9.5293804174768
2.7082039324994
...

result:

ok 1781 numbers

Test #37:

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

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: 34ms
memory: 7104kb

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.4624881650414
15.7507967633306
53.6782422350459
82.3684440692894
13.9838009687283
37.9496244077922
19.4173827398841
26436.9548043144023
16.2765460519857
17.4551154638826
41.1397426182705
10.8863851268335
2.5412770185730
43.1240791923019
91.9368327380127
29490.0586455991943
25443.5386436928275
2652...

result:

ok 100 numbers

Test #39:

score: 0
Accepted
time: 102ms
memory: 10088kb

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.9722633644269
1395.0062626894478
65837.7160401329747
3799.0857826352494
3433.7582838398389
194.0906922274841
7369.2107256303079
265305.1531383889960
8568.3343021556902
4911.6507692489276
54497.5243289319624
3603.7536804999231
3575.1208188543314
159352.0178493278509
3626.6086766661856
100481.17...

result:

ok 100000 numbers

Test #40:

score: 0
Accepted
time: 114ms
memory: 7668kb

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.6361725391234
5614.8046000556988
18063.4913598158601
48666.3501369986334
29146.2021537901965
1712.9325200998517
166623.0474619099696
37945.2261243401299
14861.6897492694079
52982.2835615195654
2858.9781204075848
13281.3495404316418
2313.8172852286102
9696.1464429239386
24522.0064309631052
915.7...

result:

ok 100000 numbers

Test #41:

score: 0
Accepted
time: 117ms
memory: 11372kb

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.0000000000000
9.0000000000000
9.0000000000000
9.0000000000000
1.0076209824032
2.0000000000000
11.4017621445907
11.4017542509914
8.0063054999637
9.0000100001000
9.0000000000000
20.1246117974981
0.1107702762748
2.0000000000000
19.313217...

result:

ok 99999 numbers

Test #42:

score: 0
Accepted
time: 136ms
memory: 11860kb

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.8692960482628
10.5470841016719
20.3382454628051
11.0472391774514
29307.6437463289476
8.6969391828883
12.9822052411929
42.2088256856744
18.2848468366596
1.3245014228656
89248.1133292885061
10.6987302580919
12.0639242325825
82.4567908908352
0.2739294505252
4.0821021569845
229619.2954495684535
173821...

result:

ok 100000 numbers

Test #43:

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

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.6181405492243
10.7354445175440
2.7296714993175
305762.7775181703037
18.1307777901915
24.2547682094326
9.7506016302401
7.1811992372827
9.1855282105804
51.8640420520024
57.7841921802587
304131.5864052721881
91.1310961957866
21.5119422204697
5.6104899817156
13.2966428264626
149597.3100500288710
...

result:

ok 100000 numbers

Test #44:

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

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.0402331255709
17.8425845809605
17.0751145444240
11.2809525830567
219404.3062970769824
27.0776255335347
228139.7750113377697
14.1896895951867
32.1516847697745
13.9588072590661
30.4749015727292
352634.1106456191046
220634.7687600593781
67.3379724527838
65.6108846852436
7.9546469271322
8.880469192945...

result:

ok 100000 numbers