QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#18124#2267. Jewelry Sizejufadangerous#AC ✓23ms4560kbC++205.1kb2022-01-16 12:15:292022-05-04 17:08:54

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-05-04 17:08:54]
  • 评测
  • 测评结果:AC
  • 用时:23ms
  • 内存:4560kb
  • [2022-01-16 12:15:29]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 4000000000000000000 //オーバーフローに注意
#define MOD 1000000007
//#define EPS 0.000000001



#define EPS 0.0000000001
#define SIZE 1005

struct Point{
	Point(double arg_x,double arg_y){
		x = arg_x;
		y = arg_y;
	}

	Point(){
		x = y = 0.0;
	}

	Point operator + (Point p){ return Point(x+p.x,y+p.y); }
	Point operator - (Point p){ return Point(x-p.x,y-p.y);}
	Point operator * (double a){ return Point(a*x,a*y); }
	Point operator / (double a){ return Point(x/a,y/a); }

	double abs(){ return sqrt(norm()); }
	double norm(){ return x*x + y*y; }

	bool operator<(const Point &p) const{

		if(fabs(x-p.x) > EPS){

			return x < p.x;
		}else{

			return y < p.y;
		}
	}

	bool operator == (const Point &p) const{
		return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
	}


	void debug(){

		printf("(%.3lf,%.3lf)\n",x,y);
	}

	double x,y;
};

typedef Point Vector;
typedef vector<Point> Polygon;

struct Line{
	Line(){

	}
	Line(Point a,Point b){
		p[0] = a;
		p[1] = b;
	}
	/*void outPut(){

		printf("(%.3lf,%.3lf)-(%.3lf,%.3lf)\n",p[0].x,p[0].y,p[1].x,p[1].y);
	}*/
	Point p[2];
};

struct Circle{
	Point center;
	double r;
};

int N;
double X[SIZE];


double calc_dist(Point A,Point B){

	return sqrt((A.x-B.x)*(A.x-B.x)+(A.y-B.y)*(A.y-B.y));
}


double norm(Vector a){
	return a.x*a.x+a.y*a.y;
}

double abs(Vector a){
	return sqrt(norm(a));
}

double cross(Vector a,Vector b){
    return a.x*b.y-a.y*b.x;
}

double dot(Vector a,Vector b){
    return a.x*b.x + a.y*b.y;
}

static const int COUNTER_CLOCKWISE = 1;
static const int CLOCKWISE = -1;
static const int ONLINE_BACK = 2;
static const int ONLINE_FRONT = -2;
static const int ON_SEGMENT = 0;

/*
 * p0を基準点として、p1から見てp2が
 * 反時計回り側にあれば
 * COUNTER_CLOCKWISE
 * */
int ccw(Point p0,Point p1,Point p2){

	Vector a = p1 - p0;
	Vector b = p2 - p0;

	if(cross(a,b) > EPS)return COUNTER_CLOCKWISE;
	if(cross(a,b) < -EPS)return CLOCKWISE;
	if(dot(a,b) < -EPS)return ONLINE_BACK;
	if(a.norm() < b.norm())return ONLINE_FRONT;

	return ON_SEGMENT;
}

double arg(Vector p){
	return atan2(p.y,p.x);
}

Vector polar(double a,double r){
	return Point(cos(r)*a,sin(r)*a);
}

//円と円の交点
vector<Point> getCrossPoints(Circle c1,Circle c2){

	vector<Point> res;

	double d = abs(c1.center-c2.center);
	double a = acos((c1.r*c1.r+d*d-c2.r*c2.r)/(2*c1.r*d));
	double t = arg(c2.center-c1.center);

	res.push_back(Point(c1.center+polar(c1.r,t+a)));
	res.push_back(Point(c1.center+polar(c1.r,t-a)));

	return res;
}

//点のradを求める関数
double calc_rad(Point p){

	if(p.y == 0){

		if(p.x > 0){

			return 0;

		}else{ //p.x < 0

			return M_PI;
		}

	}else if(p.x == 0){

		if(p.y > 0){

			return M_PI/2.0;
		}else{


			return 3*M_PI/2.0;
		}

	}else{

		double base = atan(fabs(p.y)/fabs(p.x));

		if(p.x > 0){

			if(p.y > 0){

				return base;

			}else{ //p.y < 0

				return 2*M_PI-base;
			}

		}else{ //p.x < 0

			if(p.y > 0){

				return M_PI-base;

			}else{

				return base+M_PI;
			}
		}
	}
}


bool is_large(double R){

	Circle C;
	C.center = Point(0,0);
	C.r = R;

	Point P = Point(R,0);
	double pre_rad = 0;

	for(int i = 0; i < N; i++){

		Circle work;
		work.center = P;
		work.r = X[i];

		double tmp_dist = calc_dist(C.center,P);
		if(tmp_dist+R+EPS < X[i]){ //workの円が、基準円を内部に含む場合

			return false;
		}

		vector<Point> vec = getCrossPoints(C,work);
		Point next_P;

		if(ccw(C.center,P,vec[0]) == COUNTER_CLOCKWISE){

			next_P = vec[0];
		}else{

			next_P = vec[1];
		}

		double next_rad = calc_rad(next_P);
		if(next_rad < pre_rad){
			if(next_rad > EPS){ //■1周した
				return false;
			}
		}
		pre_rad = next_rad;
		P = next_P;
	}

	return true;
}

bool isOK(double R){

	double maxi = 0;

	double sum = 0;
	for(int i = 0; i < N; i++){

		double tmp = 2*asin(X[i]/(2*R));
		if(tmp > maxi){
			maxi = tmp;
		}
		sum += tmp;
	}

	return sum-maxi >= maxi;
}

int main(){

	scanf("%d",&N);

	double maxi = 0;
	for(int i = 0; i < N; i++){

		scanf("%lf",&X[i]);
		maxi = max(maxi,X[i]);
	}

	double R = maxi/2;
	double base = 0;

	for(int i = 0; i < N; i++){

		base += 2*asin(X[i]/(2*R));
	}

	if(base >= 2*M_PI){

		double left = maxi/2-EPS,right = maxi*1000,mid = (left+right)/2;
		double ans = right;

		for(int loop = 0; loop < 100; loop++){
			if(is_large(mid)){

				ans = mid;
				right = mid;

			}else{

				left = mid;
			}
			mid = (left+right)/2;
		}

		printf("%.12lf\n",ans);

	}else{

		double left = maxi/2-EPS,right = maxi*1000,mid = (left+right)/2;
		double ans = right;

		for(int loop = 0; loop < 100; loop++){
			if(isOK(mid)){

				ans = mid;
				right = mid;

			}else{

				left = mid;
			}
			mid = (left+right)/2;
		}

		printf("%.12lf\n",ans);
	}

	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

5
3 1 6 1 7

output:

3.544404350898

result:

ok found '3.5444044', expected '3.5444044', error '0.0000000'

Test #2:

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

input:

3
500 300 400

output:

249.999999999950

result:

ok found '250.0000000', expected '250.0000000', error '0.0000000'

Test #3:

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

input:

8
2000 3000 4000 2000 3000 4000 2000 3000

output:

3780.974120543323

result:

ok found '3780.9741205', expected '3780.9741206', error '0.0000000'

Test #4:

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

input:

10
602 67 67 67 67 67 67 67 67 67

output:

3003.139816965468

result:

ok found '3003.1398170', expected '3003.1398170', error '0.0000000'

Test #5:

score: 0
Accepted
time: 19ms
memory: 4548kb

input:

1000
4719 3755 2542 1190 5557 3641 5426 1578 5247 3181 3524 983 4151 4337 3004 2062 1048 4739 499 2530 1378 450 5459 651 1714 4051 416 4186 2598 1031 374 5523 4787 1122 4919 2549 4763 4345 2333 4009 5732 5857 3198 3882 2399 4409 4151 3447 1353 4650 4184 2731 3307 3642 3383 5021 5899 2005 3206 702 30...

output:

490696.129787679238

result:

ok found '490696.1297877', expected '490696.1297935', error '0.0000000'

Test #6:

score: 0
Accepted
time: 19ms
memory: 4560kb

input:

1000
2443 973 5013 5104 418 5498 2436 5522 512 1539 3851 355 50 4167 3205 286 1171 5083 867 2208 2497 2455 3142 2247 1531 2986 862 5930 3449 4996 5201 5892 5969 4214 4995 4594 1917 5637 4115 2429 5383 171 990 5433 4338 4195 5720 5509 1483 4793 1716 2187 5454 3065 4434 984 4257 3503 5120 1705 2498 43...

output:

463780.048472624447

result:

ok found '463780.0484726', expected '463780.0484799', error '0.0000000'

Test #7:

score: 0
Accepted
time: 19ms
memory: 4296kb

input:

1000
1854 1474 3499 1575 1422 3130 2402 5948 2378 2670 3423 5104 295 1663 475 66 2687 2978 4618 3027 90 5982 4390 5990 4343 4206 465 4394 2436 5904 3740 4290 5585 5445 4071 1006 2575 472 5161 3159 1348 2583 2262 1643 4247 944 5917 933 3922 4534 2166 2218 4515 555 2208 2857 2967 879 5457 5403 4989 31...

output:

474979.623597629834

result:

ok found '474979.6235976', expected '474979.6236043', error '0.0000000'

Test #8:

score: 0
Accepted
time: 23ms
memory: 4356kb

input:

1000
2343 137 3849 255 2682 1652 1797 4299 3474 4549 3158 4921 4489 2138 1620 2009 4673 5285 355 2131 139 1855 3936 1840 4743 3946 5455 3742 1890 4475 95 2439 4613 2150 2694 5501 3803 4491 3800 1276 1245 5164 196 5734 1302 22 5950 4181 5307 304 311 5446 2159 2453 5493 5108 399 3153 2849 2289 1628 11...

output:

462340.856253159989

result:

ok found '462340.8562532', expected '462340.8562630', error '0.0000000'

Test #9:

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

input:

100
4719 3755 2542 1190 5557 3641 5426 1578 5247 3181 3524 983 4151 4337 3004 2062 1048 4739 499 2530 1378 450 5459 651 1714 4051 416 4186 2598 1031 374 5523 4787 1122 4919 2549 4763 4345 2333 4009 5732 5857 3198 3882 2399 4409 4151 3447 1353 4650 4184 2731 3307 3642 3383 5021 5899 2005 3206 702 303...

output:

48616.369631486596

result:

ok found '48616.3696315', expected '48616.3696323', error '0.0000000'

Test #10:

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

input:

100
2443 973 5013 5104 418 5498 2436 5522 512 1539 3851 355 50 4167 3205 286 1171 5083 867 2208 2497 2455 3142 2247 1531 2986 862 5930 3449 4996 5201 5892 5969 4214 4995 4594 1917 5637 4115 2429 5383 171 990 5433 4338 4195 5720 5509 1483 4793 1716 2187 5454 3065 4434 984 4257 3503 5120 1705 2498 432...

output:

48970.939436436689

result:

ok found '48970.9394364', expected '48970.9394372', error '0.0000000'

Test #11:

score: 0
Accepted
time: 5ms
memory: 4548kb

input:

100
1854 1474 3499 1575 1422 3130 2402 5948 2378 2670 3423 5104 295 1663 475 66 2687 2978 4618 3027 90 5982 4390 5990 4343 4206 465 4394 2436 5904 3740 4290 5585 5445 4071 1006 2575 472 5161 3159 1348 2583 2262 1643 4247 944 5917 933 3922 4534 2166 2218 4515 555 2208 2857 2967 879 5457 5403 4989 319...

output:

47884.149529761700

result:

ok found '47884.1495298', expected '47884.1495305', error '0.0000000'

Test #12:

score: 0
Accepted
time: 5ms
memory: 4356kb

input:

100
2343 137 3849 255 2682 1652 1797 4299 3474 4549 3158 4921 4489 2138 1620 2009 4673 5285 355 2131 139 1855 3936 1840 4743 3946 5455 3742 1890 4475 95 2439 4613 2150 2694 5501 3803 4491 3800 1276 1245 5164 196 5734 1302 22 5950 4181 5307 304 311 5446 2159 2453 5493 5108 399 3153 2849 2289 1628 115...

output:

48019.615164320814

result:

ok found '48019.6151643', expected '48019.6151651', error '0.0000000'

Test #13:

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

input:

10
4719 3755 2542 1190 5557 3641 5426 1578 5247 3181

output:

6009.545252893315

result:

ok found '6009.5452529', expected '6009.5452530', error '0.0000000'

Test #14:

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

input:

10
2443 973 5013 5104 418 5498 2436 5522 512 1539

output:

4889.467495816940

result:

ok found '4889.4674958', expected '4889.4674959', error '0.0000000'

Test #15:

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

input:

10
1854 1474 3499 1575 1422 3130 2402 5948 2378 2670

output:

4340.866170932542

result:

ok found '4340.8661709', expected '4340.8661710', error '0.0000000'

Test #16:

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

input:

10
2343 137 3849 255 2682 1652 1797 4299 3474 4549

output:

4123.016589860305

result:

ok found '4123.0165899', expected '4123.0165899', error '0.0000000'

Test #17:

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

input:

250
4719 3755 2542 1190 5557 3641 5426 1578 5247 3181 3524 983 4151 4337 3004 2062 1048 4739 499 2530 1378 450 5459 651 1714 4051 416 4186 2598 1031 374 5523 4787 1122 4919 2549 4763 4345 2333 4009 5732 5857 3198 3882 2399 4409 4151 3447 1353 4650 4184 2731 3307 3642 3383 5021 5899 2005 3206 702 303...

output:

128109.406514911097

result:

ok found '128109.4065149', expected '128109.4065170', error '0.0000000'

Test #18:

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

input:

250
2443 973 5013 5104 418 5498 2436 5522 512 1539 3851 355 50 4167 3205 286 1171 5083 867 2208 2497 2455 3142 2247 1531 2986 862 5930 3449 4996 5201 5892 5969 4214 4995 4594 1917 5637 4115 2429 5383 171 990 5433 4338 4195 5720 5509 1483 4793 1716 2187 5454 3065 4434 984 4257 3503 5120 1705 2498 432...

output:

125432.988180534405

result:

ok found '125432.9881805', expected '125432.9881825', error '0.0000000'

Test #19:

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

input:

250
1854 1474 3499 1575 1422 3130 2402 5948 2378 2670 3423 5104 295 1663 475 66 2687 2978 4618 3027 90 5982 4390 5990 4343 4206 465 4394 2436 5904 3740 4290 5585 5445 4071 1006 2575 472 5161 3159 1348 2583 2262 1643 4247 944 5917 933 3922 4534 2166 2218 4515 555 2208 2857 2967 879 5457 5403 4989 319...

output:

116578.993059398039

result:

ok found '116578.9930594', expected '116578.9930612', error '0.0000000'

Test #20:

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

input:

250
2343 137 3849 255 2682 1652 1797 4299 3474 4549 3158 4921 4489 2138 1620 2009 4673 5285 355 2131 139 1855 3936 1840 4743 3946 5455 3742 1890 4475 95 2439 4613 2150 2694 5501 3803 4491 3800 1276 1245 5164 196 5734 1302 22 5950 4181 5307 304 311 5446 2159 2453 5493 5108 399 3153 2849 2289 1628 115...

output:

118802.716841866539

result:

ok found '118802.7168419', expected '118802.7168438', error '0.0000000'

Test #21:

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

input:

3
4719 3755 2542

output:

2368.991348992992

result:

ok found '2368.9913490', expected '2368.9913490', error '0.0000000'

Test #22:

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

input:

3
5104 418 5498

output:

7931.549791727090

result:

ok found '7931.5497917', expected '7931.5497917', error '0.0000000'

Test #23:

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

input:

3
2670 3423 5104

output:

2776.819737716839

result:

ok found '2776.8197377', expected '2776.8197377', error '0.0000000'

Test #24:

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

input:

3
1797 4299 3474

output:

2222.975093858321

result:

ok found '2222.9750939', expected '2222.9750939', error '0.0000000'

Test #25:

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

input:

4
4719 3755 2542 1190

output:

2385.884482886203

result:

ok found '2385.8844829', expected '2385.8844829', error '0.0000000'

Test #26:

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

input:

4
2443 973 5013 5104

output:

2673.310104165119

result:

ok found '2673.3101042', expected '2673.3101042', error '0.0000000'

Test #27:

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

input:

4
1854 1474 3499 1575

output:

1762.718481806271

result:

ok found '1762.7184818', expected '1762.7184818', error '0.0000000'

Test #28:

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

input:

4
2682 1652 1797 4299

output:

2155.775072465035

result:

ok found '2155.7750725', expected '2155.7750725', error '0.0000000'

Test #29:

score: 0
Accepted
time: 13ms
memory: 4356kb

input:

500
4719 3755 2542 1190 5557 3641 5426 1578 5247 3181 3524 983 4151 4337 3004 2062 1048 4739 499 2530 1378 450 5459 651 1714 4051 416 4186 2598 1031 374 5523 4787 1122 4919 2549 4763 4345 2333 4009 5732 5857 3198 3882 2399 4409 4151 3447 1353 4650 4184 2731 3307 3642 3383 5021 5899 2005 3206 702 303...

output:

247805.374883731187

result:

ok found '247805.3748837', expected '247805.3748878', error '0.0000000'

Test #30:

score: 0
Accepted
time: 13ms
memory: 4432kb

input:

500
2443 973 5013 5104 418 5498 2436 5522 512 1539 3851 355 50 4167 3205 286 1171 5083 867 2208 2497 2455 3142 2247 1531 2986 862 5930 3449 4996 5201 5892 5969 4214 4995 4594 1917 5637 4115 2429 5383 171 990 5433 4338 4195 5720 5509 1483 4793 1716 2187 5454 3065 4434 984 4257 3503 5120 1705 2498 432...

output:

236689.370615228429

result:

ok found '236689.3706152', expected '236689.3706188', error '0.0000000'

Test #31:

score: 0
Accepted
time: 13ms
memory: 4316kb

input:

500
1854 1474 3499 1575 1422 3130 2402 5948 2378 2670 3423 5104 295 1663 475 66 2687 2978 4618 3027 90 5982 4390 5990 4343 4206 465 4394 2436 5904 3740 4290 5585 5445 4071 1006 2575 472 5161 3159 1348 2583 2262 1643 4247 944 5917 933 3922 4534 2166 2218 4515 555 2208 2857 2967 879 5457 5403 4989 319...

output:

240655.231696320232

result:

ok found '240655.2316963', expected '240655.2317000', error '0.0000000'

Test #32:

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

input:

500
2343 137 3849 255 2682 1652 1797 4299 3474 4549 3158 4921 4489 2138 1620 2009 4673 5285 355 2131 139 1855 3936 1840 4743 3946 5455 3742 1890 4475 95 2439 4613 2150 2694 5501 3803 4491 3800 1276 1245 5164 196 5734 1302 22 5950 4181 5307 304 311 5446 2159 2453 5493 5108 399 3153 2849 2289 1628 115...

output:

239234.459079359396

result:

ok found '239234.4590794', expected '239234.4590830', error '0.0000000'

Test #33:

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

input:

5
4719 3755 2542 1190 5557

output:

3171.259841782623

result:

ok found '3171.2598418', expected '3171.2598418', error '0.0000000'

Test #34:

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

input:

5
2443 973 5013 5104 418

output:

2706.461833721702

result:

ok found '2706.4618337', expected '2706.4618337', error '0.0000000'

Test #35:

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

input:

5
1854 1474 3499 1575 1422

output:

1804.046248234295

result:

ok found '1804.0462482', expected '1804.0462482', error '0.0000000'

Test #36:

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

input:

5
2343 137 3849 255 2682

output:

1926.485138287835

result:

ok found '1926.4851383', expected '1926.4851383', error '0.0000000'

Test #37:

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

input:

6
4719 3755 2542 1190 5557 3641

output:

3658.244184779877

result:

ok found '3658.2441848', expected '3658.2441848', error '0.0000000'

Test #38:

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

input:

6
2443 973 5013 5104 418 5498

output:

3441.784944666346

result:

ok found '3441.7849447', expected '3441.7849447', error '0.0000000'

Test #39:

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

input:

6
1854 1474 3499 1575 1422 3130

output:

2223.647330558701

result:

ok found '2223.6473306', expected '2223.6473306', error '0.0000000'

Test #40:

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

input:

6
2343 137 3849 255 2682 1652

output:

2013.752377590858

result:

ok found '2013.7523776', expected '2013.7523776', error '0.0000000'

Test #41:

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

input:

7
4719 3755 2542 1190 5557 3641 5426

output:

4485.567342567726

result:

ok found '4485.5673426', expected '4485.5673426', error '0.0000000'

Test #42:

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

input:

7
2443 973 5013 5104 418 5498 2436

output:

3760.180157519524

result:

ok found '3760.1801575', expected '3760.1801576', error '0.0000000'

Test #43:

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

input:

7
1854 1474 3499 1575 1422 3130 2402

output:

2569.838445479194

result:

ok found '2569.8384455', expected '2569.8384455', error '0.0000000'

Test #44:

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

input:

7
2343 137 3849 255 2682 1652 1797

output:

2218.938074871353

result:

ok found '2218.9380749', expected '2218.9380749', error '0.0000000'

Test #45:

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

input:

3
3 4 5

output:

2.500000000000

result:

ok found '2.5000000', expected '2.5000000', error '0.0000000'

Test #46:

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

input:

5
2 2 3 4 4

output:

2.612084041714

result:

ok found '2.6120840', expected '2.6120840', error '0.0000000'

Test #47:

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

input:

4
20 30 40 50

output:

26.176484357547

result:

ok found '26.1764844', expected '26.1764844', error '0.0000000'

Test #48:

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

input:

5
20 50 40 30 60

output:

35.209574511223

result:

ok found '35.2095745', expected '35.2095745', error '0.0000000'

Test #49:

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

input:

5
11 12 13 14 15

output:

11.093161690499

result:

ok found '11.0931617', expected '11.0931617', error '0.0000000'

Test #50:

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

input:

8
1 1 1 1 1 1 1 1

output:

1.306562964857

result:

ok found '1.3065630', expected '1.3065630', error '0.0000000'

Test #51:

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

input:

3
13 12 5

output:

6.499999999950

result:

ok found '6.5000000', expected '6.5000000', error '0.0000000'

Test #52:

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

input:

3
1300 1200 400

output:

652.875413397318

result:

ok found '652.8754134', expected '652.8754134', error '0.0000000'

Test #53:

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

input:

3
60 120 130

output:

65.190480058421

result:

ok found '65.1904801', expected '65.1904801', error '0.0000000'

Test #54:

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

input:

4
6000 5801 100 100

output:

29539.489732126640

result:

ok found '29539.4897321', expected '29539.4897321', error '0.0000000'

Test #55:

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

input:

4
6000 1 6000 1

output:

3000.000041666654

result:

ok found '3000.0000417', expected '3000.0000417', error '0.0000000'

Test #56:

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

input:

4
6000 100 6000 200

output:

3000.937418647860

result:

ok found '3000.9374186', expected '3000.9374186', error '0.0000000'

Test #57:

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

input:

4
6000 5999 1 1

output:

3463.812976089624

result:

ok found '3463.8129761', expected '3463.8129761', error '0.0000000'

Test #58:

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

input:

5
6000 1501 1500 1500 1500

output:

91877.757724595722

result:

ok found '91877.7577246', expected '91877.7577247', error '0.0000000'

Test #59:

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

input:

5
6000 6000 1 1 1

output:

3000.000093749979

result:

ok found '3000.0000937', expected '3000.0000937', error '0.0000000'

Test #60:

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

input:

5
6000 6000 6000 1 1

output:

3464.294081231121

result:

ok found '3464.2940812', expected '3464.2940813', error '0.0000000'

Test #61:

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

input:

5
6000 6000 6000 6000 1

output:

4242.765688908007

result:

ok found '4242.7656889', expected '4242.7656890', error '0.0000000'

Test #62:

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

input:

5
6000 6000 6000 6000 6000

output:

5103.904850041991

result:

ok found '5103.9048500', expected '5103.9048501', error '0.0000000'

Test #63:

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

input:

5
1000 2000 3000 4000 5000

output:

2717.567225232915

result:

ok found '2717.5672252', expected '2717.5672253', error '0.0000000'

Test #64:

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

input:

4
6000 2001 2000 2000

output:

89465.079780104672

result:

ok found '89465.0797801', expected '89465.0797801', error '0.0000000'

Test #65:

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

input:

5
6000 1510 1510 1510 1510

output:

14662.354167284057

result:

ok found '14662.3541673', expected '14662.3541673', error '0.0000000'

Test #66:

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

input:

4
60 21 20 20

output:

91.679132255597

result:

ok found '91.6791323', expected '91.6791323', error '0.0000000'

Test #67:

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

input:

1000
5993 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 ...

output:

94723.644857561987

result:

ok found '94723.6448576', expected '94723.6448403', error '0.0000000'

Test #68:

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

input:

1000
1000 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

6463.684872812754

result:

ok found '6463.6848728', expected '6463.6848729', error '0.0000000'

Test #69:

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

input:

1000
998 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

6444.320998859230

result:

ok found '6444.3209989', expected '6444.3209989', error '0.0000000'

Test #70:

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

input:

1000
999 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

6454.000534379955

result:

ok found '6454.0005344', expected '6454.0005344', error '0.0000000'

Test #71:

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

input:

1000
6000 13 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6...

output:

94889.628080350405

result:

ok found '94889.6280804', expected '94889.6280885', error '0.0000000'

Test #72:

score: 0
Accepted
time: 22ms
memory: 4436kb

input:

1000
6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 6000 ...

output:

954931.229334709351

result:

ok found '954931.2293347', expected '954931.2293495', error '0.0000000'

Test #73:

score: 0
Accepted
time: 19ms
memory: 4320kb

input:

1000
600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600...

output:

95493.122933462335

result:

ok found '95493.1229335', expected '95493.1229350', error '0.0000000'

Test #74:

score: 0
Accepted
time: 18ms
memory: 4416kb

input:

1000
60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 6...

output:

9549.312293343921

result:

ok found '9549.3122933', expected '9549.3122935', error '0.0000000'

Test #75:

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

input:

3
6000 3000 3001

output:

82182.346701971226

result:

ok found '82182.3467020', expected '82182.3467020', error '0.0000000'

Test #76:

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

input:

10
6000 666 666 667 667 667 667 667 667 667

output:

94302.353098377978

result:

ok found '94302.3530984', expected '94302.3530983', error '0.0000000'

Test #77:

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

input:

10
600 66 66 67 67 67 67 67 67 67

output:

2988.206833002559

result:

ok found '2988.2068330', expected '2988.2068330', error '0.0000000'

Test #78:

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

input:

100
6000 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 ...

output:

15323.792690337128

result:

ok found '15323.7926903', expected '15323.7926903', error '0.0000000'

Test #79:

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

input:

1000
6000 7 7 7 7 7 7 7 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 ...

output:

94889.628337254515

result:

ok found '94889.6283373', expected '94889.6283282', error '0.0000000'

Test #80:

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

input:

3
6000 2999 3002

output:

82182.337576655118

result:

ok found '82182.3375767', expected '82182.3375767', error '0.0000000'

Test #81:

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

input:

4
19 13 26 13

output:

13.367997205246

result:

ok found '13.3679972', expected '13.3679972', error '0.0000000'

Test #82:

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

input:

3
3 3 2

output:

1.590990257657

result:

ok found '1.5909903', expected '1.5909903', error '0.0000000'

Test #83:

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

input:

3
4 5 6

output:

3.023715784059

result:

ok found '3.0237158', expected '3.0237158', error '0.0000000'

Test #84:

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

input:

3
3000 3000 4241

output:

2120.500633985725

result:

ok found '2120.5006340', expected '2120.5006340', error '0.0000000'

Test #85:

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

input:

3
3001 3000 6000

output:

82182.346702004856

result:

ok found '82182.3467020', expected '82182.3467020', error '0.0000000'

Test #86:

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

input:

3
6000 6000 1

output:

3000.000010416661

result:

ok found '3000.0000104', expected '3000.0000104', error '0.0000000'