QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#187171#3854. Radardoll_sister#AC ✓640ms11144kbC++141.2kb2023-09-24 15:07:012023-09-24 15:07:02

Judging History

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

  • [2023-09-24 15:07:02]
  • 评测
  • 测评结果:AC
  • 用时:640ms
  • 内存:11144kb
  • [2023-09-24 15:07:01]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int N=500005;
int n,m,q;
long double dist[N];
long double deg[N];
inline pair<long double,long double>getdot(long double dis,long double deg){
	return make_pair(cosl(deg)*dis,sinl(deg)*dis);
}
void work(){
	long double ans=1e100;
	int x,y;
	cin>>x>>y;
	long double D=hypotl(x,y),ang=atan2l(y,x);
	int it=lower_bound(deg+1,deg+m+1,ang)-deg;
	for(int i=-3;i<=3;i++){
		long double w=fabsl(cosl(ang-deg[(it+i+m)%m+1])*D);
		int p=lower_bound(dist+1,dist+n+1,w)-dist;
		for(int j=-3;j<=3;j++){
			if(p+j>=1&&p+j<=n){
				auto res=getdot(dist[p+j],deg[(it+i+m)%m+1]);
				ans=min(ans,hypotl(res.first-x,res.second-y));
			}
			if(1>=1&&1<=n){
				auto res=getdot(dist[1],deg[(it+i+m)%m+1]);
				ans=min(ans,hypotl(res.first-x,res.second-y));
			}
		}
	}
	cout<<ans<<'\n';
}
int main(){
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	cout<<fixed<<setprecision(11);
	cin>>n>>m>>q;
	for(int i=1;i<=n;++i)
	cin>>dist[i];
	dist[++n]=1e8;
	sort(dist+1,dist+n+1);
	for(int i=1;i<=m;++i){
		int x,y;
		cin>>x>>y;
		deg[i]=atan2l(y,x);
	}
	sort(deg+1,deg+m+1);
	for(;q--;)work();
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 6072kb

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.60529107292
0.97777229047
1.55184510540
1.41421356237

result:

ok 4 numbers

Test #2:

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

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.87498509926
15.87498509926
15.87498509926
15.87498509926
15.87498509926
15.87498509926
15.87498509926
15.87498509926
4.92965670105
4.92965670105
4.92965670105
4.92965670105
4.92965670105
4.92965670105
4.92965670105
4.92965670105
2.00000000000
2.00000000000
2.00000000000
2.00000000000
0.0710678118...

result:

ok 32 numbers

Test #3:

score: 0
Accepted
time: 7ms
memory: 6036kb

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.05538513814
4.12310562562
3.60555127546
11.04536101719
15.29705854078
1.41421356237
8.24621125124
7.00000000000
8.94427191000
3.00000000000
12.16552506060
5.00000000000
5.09901951359
11.18033988750
1.41421356237
2.00000000000
2.00000000000
3.00000000000
3.16227766017
8.24621125124
4.47213595500
5....

result:

ok 1681 numbers

Test #4:

score: 0
Accepted
time: 7ms
memory: 6056kb

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.77737211930
4.63159368259
6.89565610098
12.29142290537
6.55596400358
4.27030420605
4.39253600045
6.36782588575
6.55596400358
2.99031637937
10.18752035950
2.83362616651
2.97706483137
4.69677986016
4.35223988869
11.32845580980
3.38403014771
1.83645936574
2.94725151642
7.63513189585
9.09218466976
8....

result:

ok 1681 numbers

Test #5:

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

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.00000000000
4.00000000000
4.00000000000
4.00000000000
5.00000000000
5.00000000000
5.00000000000
5.00000000000
1.00000000000
1.00000000000
1.00000000000
1.00000000000
8.06225774830
8.06225774830
8.06225774830
8.06225774830

result:

ok 16 numbers

Test #6:

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

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.00000000000
2.00000000000
4.00000000000
8.00000000000
16.00000000000
32.00000000000
64.00000000000
128.00000000000
256.00000000000
512.00000000000
1024.00000000000
2048.00000000000
4096.00000000000
8192.00000000000
16384.00000000000
32768.00000000000
65536.00000000000
131072.00000000000
262144.000...

result:

ok 120 numbers

Test #7:

score: 0
Accepted
time: 8ms
memory: 6104kb

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.39307159590
16.45344124348
14.47564008524
19.04323136814
16.18293241745
19.04323136814
19.01057653659
3.30589355366
11.76318762080
14.66730836006
16.29552563980
7.61770551095
16.69265290302
25.87005768509
16.18293219876
20.08487043158
10.69451168454
19.29511600747
23.75926188494
19.33616563923
17....

result:

ok 1681 numbers

Test #8:

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

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.00000000000
3.00000000000
2.00000000000
1.00000000000
0.00000000000
1.00000000000
2.00000000000
1.00000000000
0.00000000000
1.00000000000
2.00000000000
3.00000000000
4.00000000000
3.00000000000
2.00000000000
1.00000000000
0.00000000000
1.00000000000
2.00000000000
3.00000000000
4.00000000000
3.0000...

result:

ok 108 numbers

Test #9:

score: 0
Accepted
time: 7ms
memory: 6084kb

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.21954445729
3.16227766017
15.03329637837
6.70820393250
6.00000000000
19.10497317454
12.00000000000
1.00000000000
5.65685424949
4.12310562562
1.41421356237
5.09901951359
12.36931687685
19.23538406167
6.00000000000
9.48683298051
6.32455532034
4.12310562562
18.02775637732
4.47213595500
13.34166406413...

result:

ok 1681 numbers

Test #10:

score: 0
Accepted
time: 8ms
memory: 6100kb

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.41421356237
18.43908891459
4.47213595500
12.04159457879
14.31782106328
10.44030650891
19.02629759044
15.03329637837
3.60555127546
8.54400374532
18.02775637732
17.46424919657
20.00000000000
5.00000000000
13.34166406413
10.04987562112
18.02775637732
16.00000000000
1.41421356237
19.10497317454
17.000...

result:

ok 1681 numbers

Test #11:

score: 0
Accepted
time: 7ms
memory: 6000kb

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.34166796559
7.61577310586
19.23539988168
17.26268044471
14.14213562373
18.02776437299
10.19804687968
11.70469991072
6.00000000000
16.03121954188
14.03567683527
3.00000000000
7.28012528905
20.09975124224
14.14213958749
13.00000000000
16.27880485442
4.47213595500
8.94427191000
5.00000000000
2.00000...

result:

ok 1681 numbers

Test #12:

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

input:

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

output:

7.07106781187

result:

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

Test #13:

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

input:

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

output:

7.07106682093

result:

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

Test #14:

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

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.00000000000
0.00000000000
1.00000000000
0.00000000000
1.00000000000
2.00000000000
1.00000000000
0.00000000000
1.00000000000
2.00000000000
3.00000000000
4.00000000000
5.00000000000
6.00000000000
7.00000000000
8.00000000000
9.00000000000
10.00000000000
1.41421356237
2.23606797750
3.16227766017
4.123...

result:

ok 36 numbers

Test #15:

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

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.31827318951
3.14737923922
3.04300366456
5.60113965764
6.29475847845
6.55343849686
6.08600732911
7.48016453312

result:

ok 8 numbers

Test #16:

score: 0
Accepted
time: 601ms
memory: 9696kb

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.99886570187
14.52542301876
21.07310211779
31.84318911324
115.92489501362
49.99139105494
60.50662971644
69.95813003959
134.90230815124
90.17256143142
100.22015141167
110.15485288507
119.83813805765
169.25925992483
139.85771380997
149.90386261210
159.81303401932
169.92400891297
209.99705092232
189....

result:

ok 99999 numbers

Test #17:

score: 0
Accepted
time: 623ms
memory: 9292kb

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.00000000000
15.29584130897
21.47208150316
30.83930851980
35.00655527252
50.93145810748
60.50661982900
70.36379544220
80.00703893712
90.05617132163
100.00063329305
110.05050827977
119.83812808572
129.88519798928
134.86807647616
149.83387463627
159.95046967692
169.92399894002
174.78545520732
189.62...

result:

ok 99999 numbers

Test #18:

score: 0
Accepted
time: 640ms
memory: 11144kb

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.00000000000
11.79353732894
15.00685156938
30.31687408905
40.11390682086
50.14093371745
60.17558431526
70.36379544220
80.12553480139
89.85635145977
100.00063329305
109.95516961431
119.76728224088
129.81213197922
139.93267084688
149.71386005667
159.75364661470
169.73874122485
179.90046715245
189.81...

result:

ok 99999 numbers

Test #19:

score: 0
Accepted
time: 8ms
memory: 6024kb

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.24811447698
1548.72811091166
1574.07085019195
1568.85515660963
1558.58257813904
1562.01476409869
1556.58427177907
1558.56463800755
1566.85054815816
1566.94850782386
1544.53941220917
1556.45519778384
1555.18223226812
1562.69996658206
1569.16389539482
1561.12101686029
1545.52168009524
1543.0646...

result:

ok 1781 numbers

Test #20:

score: 0
Accepted
time: 7ms
memory: 6052kb

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.06834344928
455444.03730527102
455456.30660965142
455477.37004875388
455453.18351503767
455440.18706222854
455465.03076493637
455465.71064261471
455475.71220190275
455459.63788507120
455454.60356876411
455458.90591079302
455452.06328764423
455464.83513711568
455466.56602079263
455472.10670741...

result:

ok 1781 numbers

Test #21:

score: 0
Accepted
time: 4ms
memory: 5980kb

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.47448608079
284359.79373264516
284363.97387831340
284349.90822609415
284348.81350970569
284360.55981077031
284354.99743161696
284364.12474533744
284362.68000457556
284362.49679081948
64050.72021068456
284352.72599714901
284351.40094959888
284351.03783207687
284357.90779170415
284361.143620402...

result:

ok 1781 numbers

Test #22:

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

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.62139464305
393120.74490368163
393130.18935158875
393123.05859969070
393128.13429689735
393119.03337907307
393131.71643136374
393123.27562185866
393117.28858538611
393128.21922607202
393128.29763732965
393121.16589611834
393113.82988657926
393115.18905691196
393125.09845925621
393130.38305493...

result:

ok 1781 numbers

Test #23:

score: 0
Accepted
time: 8ms
memory: 6044kb

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.93541503939
234686.78076298277
234696.22405209682
234689.23462418916
234681.50983354127
234688.32522228439
234690.98553042093
234685.31470146879
234697.88306297360
234685.98333338464
234683.34292096437
234692.97809746506
234686.07639461397
234686.24027940048
396836.11492530208
313138.09786057...

result:

ok 1781 numbers

Test #24:

score: 0
Accepted
time: 7ms
memory: 6096kb

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.44641863714
427613.18543997504
427604.19693780247
427623.36897196959
427607.13360153889
427612.81641323307
427615.35449848004
427597.85368265010
427608.72995587243
427602.78677933781
427604.03770326255
427604.61211882396
427612.18063345464
427618.99499668599
427621.96392005717
427601.41037060...

result:

ok 1781 numbers

Test #25:

score: 0
Accepted
time: 8ms
memory: 6036kb

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.91651688570
4368.07587066585
4363.00200987500
4351.15785636978
4369.07182157044
4360.81011560248
4359.49612861851
4364.15210823206
4372.29116491935
4363.80849163730
4356.86540607719
4360.21154821110
4362.49634419420
4358.76483163773
4357.22915523804
4358.93191045964
4358.00252089900
546468.2508...

result:

ok 1781 numbers

Test #26:

score: 0
Accepted
time: 6ms
memory: 6036kb

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.60332543744
730974.08228288513
730965.48510232404
730979.79298754594
730970.73839133058
731000.14045905244
730970.30922725406
730996.55786904792
730961.61555121376
730976.59082960972
730959.80011716937
730979.52849791275
730970.64454855041
730971.74432133451
730991.90143698083
730983.23041893...

result:

ok 1781 numbers

Test #27:

score: 0
Accepted
time: 6ms
memory: 5936kb

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.20626779191
1169879.34847451521
372097.80616288073
372088.17689014504
372081.49799024567
372081.01466974923
372057.62184672706
372089.50173864315
372069.49100418167
372077.25418042474
372071.92620064295
372082.75091222263
372088.44402755095
372062.60323999307
372062.17232248114
372088.0656901...

result:

ok 1781 numbers

Test #28:

score: 0
Accepted
time: 8ms
memory: 6088kb

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.07376774070
10.85847445599
7.64939994719
8.50496140732
9.38455903041
7.83287542354
1.44265209756
15.73422639340
16.86631150620
12.60790007384
21.79197009461
6.47758784364
6.17592784559
13.78820371912
8.17517515781
14.16388424260
18.25790016705
6.94837699871
9.51754493716
4.64944952665
12.84994919...

result:

ok 1781 numbers

Test #29:

score: 0
Accepted
time: 3ms
memory: 6040kb

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.00000000000
10.19803902719
12.42802655785
1330347.14979609811
8.23580154719
10.50979753005
11.66673469194
8.60232526704
15.56737440131
3.60555127546
19.20937271230
20.44636456364
7.21110255093
12.74139496878
12.38477631085
11.96933311692
8.93194569450
3.46410161514
8.54400374532
398065.7614577914...

result:

ok 1781 numbers

Test #30:

score: 0
Accepted
time: 9ms
memory: 6056kb

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.40402053276
20.38893258993
10.21955664412
20.92534569622
5.04413112194
12.24807920641
2.87548450340
2.68850551351
16.34866142040
12.64724874207
11.53339402877
1.36333233435
23.96443357152
2.72424053770
9.61474174252
6.29381248933
6.83516567083
7.69062798596
5.92933645003
7.35812289818
5.5494145686...

result:

ok 1781 numbers

Test #31:

score: 0
Accepted
time: 6ms
memory: 6040kb

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.93989124509
7.63615483713
9.39324017286
10.38278618100
14.47032346973
7.06354246919
8.73037670224
24.09276694942
201368.83607597749
5.39690588755
9.10644503465
17.82881558180
24.47023713307
17.73800174331
11.39968453348
13.56808329146
18.69486908151
19.40796006618
17.46101057851
11.63631148176
18...

result:

ok 1781 numbers

Test #32:

score: 0
Accepted
time: 6ms
memory: 5912kb

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.71450244498
25.43608921323
16.87629565095
26.16413213478
11.36667832634
31.20004726015
26.95662279697
25.93429053936
22.98766678237
28.22278807891
10.74902602514
5.69908752252
26.93079639389
21.33652364995
24.21201408498
25.57493204893
27.68954760396
1162982.79050175262
17.39208616178
11.68002578...

result:

ok 1781 numbers

Test #33:

score: 0
Accepted
time: 3ms
memory: 6088kb

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.12090029354
12.27722766850
25.75671338183
6.99411152461
23.98251597080
7.03921647416
11.85113629277
20.90902381257
16.75154438828
14.31298191631
15.17241820807
24.93579736136
17.09370492726
18.67713018741
14.73435228099
11.49629540168
2.53071013084
5.17520850093
14.12610466113
14.08787296183
26.0...

result:

ok 1781 numbers

Test #34:

score: 0
Accepted
time: 4ms
memory: 5996kb

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.93265086959
7.21110255093
5.00000000000
12.18229431634
18.00000000000
0.27740242378
12.93304077342
1024855.13624225956
12.41912355714
3.25576411922
5.66388503009
9.09781783070
16.05615146914
16.12698340156
4.53887255740
12.77877989409
11.46115754077
10.69963570205
4.12310562562
18.57426704481
11....

result:

ok 1781 numbers

Test #35:

score: 0
Accepted
time: 6ms
memory: 5976kb

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.56875398168
25.12981263993
22.08819798795
19.74962706868
15.39533234087
17.10471349105
17.16955228129
13.35059610440
22.12051687334
22.16603146124
26.00609505095
12.79694770646
17.01445853740
18.16678127470
24.45176429829
23.17669689574
24.99396761727
0.99205470156
24.79599352500
17.80896222481
1...

result:

ok 1781 numbers

Test #36:

score: 0
Accepted
time: 7ms
memory: 5828kb

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.23606797750
8.79600299943
15.69729177253
19.47576133439
9.05538513814
11.39467105240
5.09901951359
19.00000000000
8.61941833973
9.19252551353
16.67202079529
714191.23933719601
13.98942591052
2.65241403744
9.84885780180
16.26752801233
9.52938041748
2.70820393250
5.76247002254
15.36458917290
9.09995...

result:

ok 1781 numbers

Test #37:

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

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.97777229047
2.75012077390
0.84677770801
1.46407105292
0.58578643763

result:

ok 5 numbers

Test #38:

score: 0
Accepted
time: 48ms
memory: 10700kb

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.46248816504
15.75079676331
53.67824223505
82.36844406928
13.98380096873
37.94962440779
19.41738273988
26436.95480431445
16.27654605202
17.45511546385
41.13974261825
10.88638512688
2.54127701858
43.12407919230
91.93683273800
29490.05864559934
25443.53864369291
26521.91753581321
25.70349592774
22.20...

result:

ok 100 numbers

Test #39:

score: 0
Accepted
time: 561ms
memory: 8968kb

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.97226336439
1395.00626268943
65837.71604013299
3799.08578263525
3433.75828383979
194.09069222750
7369.21072563030
265305.15313838889
8568.33430215573
4911.65076924880
54497.52432893192
3603.75368049985
3575.12081885435
159352.01784932798
3626.60867666629
100481.17887100879
74738.61238272591
28...

result:

ok 100000 numbers

Test #40:

score: 0
Accepted
time: 621ms
memory: 8080kb

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.63617253913
5614.80460005570
18063.49135981586
48666.35013699864
29146.20215379020
1712.93252009982
166623.04746190995
37945.22612434011
14861.68974926943
52982.28356151956
2858.97812040758
13281.34954043165
2313.81728522855
9696.14644292394
24522.00643096315
915.75526489096
11130.98876133805
9...

result:

ok 100000 numbers

Test #41:

score: 0
Accepted
time: 619ms
memory: 9704kb

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.00000000000
7.00000000000
7.00000000000
7.00000000000
9.00000000000
9.00000000000
9.00000000000
9.00000000000
1.00762098240
2.00000000000
11.40176214459
11.40175425099
8.00630549996
9.00001000010
9.00000000000
20.12461179750
0.11077027627
2.00000000000
19.31321723597
19.31320791583
16.01261099993
...

result:

ok 99999 numbers

Test #42:

score: 0
Accepted
time: 622ms
memory: 10260kb

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.86929604825
10.54708410169
20.33824546278
11.04723917744
29307.64374632908
8.69693918289
12.98220524116
42.20882568568
18.28484683665
1.32450142286
89248.11332928845
10.69873025810
12.06392423259
82.45679089085
0.27392945054
4.08210215696
229619.29544956845
173821.01830762957
20.91614541514
1.8833...

result:

ok 100000 numbers

Test #43:

score: 0
Accepted
time: 630ms
memory: 10484kb

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.61814054922
10.73544451753
2.72967149934
305762.77751817021
18.13077779020
24.25476820947
9.75060163024
7.18119923733
9.18552821061
51.86404205200
57.78419218024
304131.58640527213
91.13109619577
21.51194222049
5.61048998179
13.29664282641
149597.31005002890
6.00746500567
13.37895948967
6.608...

result:

ok 100000 numbers

Test #44:

score: 0
Accepted
time: 630ms
memory: 10900kb

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.04023312562
17.84258458096
17.07511454442
11.28095258306
219404.30629707698
27.07762553351
228139.77501133777
14.18968959520
32.15168476975
13.95880725908
30.47490157272
352634.11064561915
220634.76876005942
67.33797245278
65.61088468524
7.95464692710
8.88046919294
24.57664608886
25.15765505241
10...

result:

ok 100000 numbers