QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#420709 | #8677. Carl’s Vacation | bulijiojiodibuliduo# | AC ✓ | 35ms | 4060kb | C++17 | 11.6kb | 2024-05-24 21:17:47 | 2024-05-24 21:17:50 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef basic_string<int> BI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(random_device{}());
const ll mod=1000000007;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head
typedef double db;
const db EPS = 1e-9;
const db PI = acos(-1.0);
inline int sign(db a) { return a < -EPS ? -1 : a > EPS; }
inline int cmp(db a, db b){ return sign(a-b); }
struct P {
db x, y;
P() {}
P(db _x, db _y) : x(_x), y(_y) {}
P operator+(P p) { return {x + p.x, y + p.y}; }
P operator-(P p) { return {x - p.x, y - p.y}; }
P operator*(db d) { return {x * d, y * d}; }
P operator/(db d) { return {x / d, y / d}; }
bool operator<(P p) const {
int c = cmp(x, p.x);
if (c) return c == -1;
return cmp(y, p.y) == -1;
}
bool operator==(P o) const{
return cmp(x,o.x) == 0 && cmp(y,o.y) == 0;
}
db dot(P p) { return x * p.x + y * p.y; }
db det(P p) { return x * p.y - y * p.x; }
db distTo(P p) { return (*this-p).abs(); }
db alpha() { return atan2(y, x); }
void read() { cin>>x>>y; }
void write() {cout<<"("<<x<<","<<y<<")"<<endl;}
db abs() { return sqrt(abs2());}
db abs2() { return x * x + y * y; }
P rot90() { return P(-y,x);}
P unit() { return *this/abs(); }
int quad() const { return sign(y) == 1 || (sign(y) == 0 && sign(x) >= 0); }
P rot(db an){ return {x*cos(an)-y*sin(an),x*sin(an) + y*cos(an)}; }
};
#define cross(p1,p2,p3) ((p2.x-p1.x)*(p3.y-p1.y)-(p3.x-p1.x)*(p2.y-p1.y))
#define crossOp(p1,p2,p3) sign(cross(p1,p2,p3))
bool chkLL(P p1, P p2, P q1, P q2) {
db a1 = cross(q1, q2, p1), a2 = -cross(q1, q2, p2);
return sign(a1+a2) != 0;
}
P isLL(P p1, P p2, P q1, P q2) {
db a1 = cross(q1, q2, p1), a2 = -cross(q1, q2, p2);
return (p1 * a2 + p2 * a1) / (a1 + a2);
}
bool intersect(db l1,db r1,db l2,db r2){
if(l1>r1) swap(l1,r1); if(l2>r2) swap(l2,r2);
return !( cmp(r1,l2) == -1 || cmp(r2,l1) == -1 );
}
bool isSS(P p1, P p2, P q1, P q2){
return intersect(p1.x,p2.x,q1.x,q2.x) && intersect(p1.y,p2.y,q1.y,q2.y) &&
crossOp(p1,p2,q1) * crossOp(p1,p2,q2) <= 0 && crossOp(q1,q2,p1)
* crossOp(q1,q2,p2) <= 0;
}
bool isSS_strict(P p1, P p2, P q1, P q2){
return crossOp(p1,p2,q1) * crossOp(p1,p2,q2) < 0 && crossOp(q1,q2,p1)
* crossOp(q1,q2,p2) < 0;
}
bool isMiddle(db a, db m, db b) {
return sign(a - m) == 0 || sign(b - m) == 0 || (a < m != b < m);
}
bool isMiddle(P a, P m, P b) {
return isMiddle(a.x, m.x, b.x) && isMiddle(a.y, m.y, b.y);
}
bool onSeg(P p1, P p2, P q){
return crossOp(p1,p2,q) == 0 && isMiddle(p1, q, p2);
}
bool onSeg_strict(P p1, P p2, P q){
return crossOp(p1,p2,q) == 0 && sign((q-p1).dot(p1-p2)) * sign((q-p2).dot(p1-p2)) < 0;
}
P proj(P p1, P p2, P q) {
P dir = p2 - p1;
return p1 + dir * (dir.dot(q - p1) / dir.abs2());
}
P reflect(P p1, P p2, P q){
return proj(p1,p2,q) * 2 - q;
}
db nearest(P p1,P p2,P q){
if (p1==p2) return p1.distTo(q);
P h = proj(p1,p2,q);
if(isMiddle(p1,h,p2))
return q.distTo(h);
return min(p1.distTo(q),p2.distTo(q));
}
db disSS(P p1, P p2, P q1, P q2){
if(isSS(p1,p2,q1,q2)) return 0;
return min(min(nearest(p1,p2,q1),nearest(p1,p2,q2)), min(nearest(q1,q2,p1),nearest(q1,q2,p2)));
}
db rad(P p1,P p2){
return atan2l(p1.det(p2),p1.dot(p2));
}
db incircle(P p1, P p2, P p3){
db A = p1.distTo(p2);
db B = p2.distTo(p3);
db C = p3.distTo(p1);
return sqrtl(A*B*C/(A+B+C));
}
//polygon
db area(vector<P> ps){
db ret = 0; rep(i,0,ps.size()) ret += ps[i].det(ps[(i+1)%ps.size()]);
return ret/2;
}
int contain(vector<P> ps, P p){ //2:inside,1:on_seg,0:outside
int n = ps.size(), ret = 0;
rep(i,0,n){
P u=ps[i],v=ps[(i+1)%n];
if(onSeg(u,v,p)) return 1;
if(cmp(u.y,v.y)<=0) swap(u,v);
if(cmp(p.y,u.y) >0 || cmp(p.y,v.y) <= 0) continue;
ret ^= crossOp(p,u,v) > 0;
}
return ret*2;
}
vector<P> convexHull(vector<P> ps) {
int n = ps.size(); if(n <= 1) return ps;
sort(ps.begin(), ps.end());
vector<P> qs(n * 2); int k = 0;
for (int i = 0; i < n; qs[k++] = ps[i++])
while (k > 1 && crossOp(qs[k - 2], qs[k - 1], ps[i]) <= 0) --k;
for (int i = n - 2, t = k; i >= 0; qs[k++] = ps[i--])
while (k > t && crossOp(qs[k - 2], qs[k - 1], ps[i]) <= 0) --k;
qs.resize(k - 1);
return qs;
}
vector<P> convexHullNonStrict(vector<P> ps) {
//caution: need to unique the Ps first
int n = ps.size(); if(n <= 1) return ps;
sort(ps.begin(), ps.end());
vector<P> qs(n * 2); int k = 0;
for (int i = 0; i < n; qs[k++] = ps[i++])
while (k > 1 && crossOp(qs[k - 2], qs[k - 1], ps[i]) < 0) --k;
for (int i = n - 2, t = k; i >= 0; qs[k++] = ps[i--])
while (k > t && crossOp(qs[k - 2], qs[k - 1], ps[i]) < 0) --k;
qs.resize(k - 1);
return qs;
}
db convexDiameter(vector<P> ps){
int n = ps.size(); if(n <= 1) return 0;
int is = 0, js = 0; rep(k,1,n) is = ps[k]<ps[is]?k:is, js = ps[js] < ps[k]?k:js;
int i = is, j = js;
db ret = ps[i].distTo(ps[j]);
do{
if((ps[(i+1)%n]-ps[i]).det(ps[(j+1)%n]-ps[j]) >= 0)
(++j)%=n;
else
(++i)%=n;
ret = max(ret,ps[i].distTo(ps[j]));
}while(i!=is || j!=js);
return ret;
}
vector<P> convexCut(const vector<P>&ps, P q1, P q2) {
vector<P> qs;
int n = ps.size();
rep(i,0,n){
P p1 = ps[i], p2 = ps[(i+1)%n];
int d1 = crossOp(q1,q2,p1), d2 = crossOp(q1,q2,p2);
if(d1 >= 0) qs.pb(p1);
if(d1 * d2 < 0) qs.pb(isLL(p1,p2,q1,q2));
}
return qs;
}
//min_dist
db min_dist(vector<P>&ps,int l,int r){
if(r-l<=5){
db ret = 1e100;
rep(i,l,r) rep(j,l,i) ret = min(ret,ps[i].distTo(ps[j]));
return ret;
}
int m = (l+r)>>1;
db ret = min(min_dist(ps,l,m),min_dist(ps,m,r));
vector<P> qs; rep(i,l,r) if(abs(ps[i].x-ps[m].x)<= ret) qs.pb(ps[i]);
sort(qs.begin(), qs.end(),[](P a,P b) -> bool {return a.y<b.y; });
rep(i,1,qs.size()) for(int j=i-1;j>=0&&qs[j].y>=qs[i].y-ret;--j)
ret = min(ret,qs[i].distTo(qs[j]));
return ret;
}
int type(P o1,db r1,P o2,db r2){
db d = o1.distTo(o2);
if(cmp(d,r1+r2) == 1) return 4;
if(cmp(d,r1+r2) == 0) return 3;
if(cmp(d,abs(r1-r2)) == 1) return 2;
if(cmp(d,abs(r1-r2)) == 0) return 1;
return 0;
}
vector<P> isCL(P o,db r,P p1,P p2){
if (cmp(abs((o-p1).det(p2-p1)/p1.distTo(p2)),r)>0) return {};
db x = (p1-o).dot(p2-p1), y = (p2-p1).abs2(), d = x * x - y * ((p1-o).abs2() - r*r);
d = max(d,(db)0.0); P m = p1 - (p2-p1)*(x/y), dr = (p2-p1)*(sqrt(d)/y);
return {m-dr,m+dr}; //along dir: p1->p2
}
vector<P> isCC(P o1, db r1, P o2, db r2) { //need to check whether two circles are the same
db d = o1.distTo(o2);
if (cmp(d, r1 + r2) == 1) return {};
if (cmp(d,abs(r1-r2))==-1) return {};
d = min(d, r1 + r2);
db y = (r1 * r1 + d * d - r2 * r2) / (2 * d), x = sqrt(r1 * r1 - y * y);
P dr = (o2 - o1).unit();
P q1 = o1 + dr * y, q2 = dr.rot90() * x;
return {q1-q2,q1+q2};//along circle 1
}
vector<P> tanCP(P o, db r, P p) {
db x = (p - o).abs2(), d = x - r * r;
if (sign(d) <= 0) return {}; // on circle => no tangent
P q1 = o + (p - o) * (r * r / x);
P q2 = (p - o).rot90() * (r * sqrt(d) / x);
return {q1-q2,q1+q2}; //counter clock-wise
}
// extanCC, intanCC : -r2, tanCP : r2 = 0
vector<pair<P, P>> tanCC(P o1, db r1, P o2, db r2) {
P d = o2 - o1;
db dr = r1 - r2, d2 = d.abs2(), h2 = d2 - dr * dr;
if (sign(d2) == 0|| sign(h2) < 0) return {};
h2 = max(0.0, h2);
vector<pair<P, P>> ret;
for (db sign : {-1, 1}) {
P v = (d * dr + d.rot90() * sqrt(h2) * sign) / d2;
ret.push_back({o1 + v * r1, o2 + v * r2});
}
if (sign(h2) == 0) ret.pop_back();
return ret;
}
db areaCT(db r, P p1, P p2){
vector<P> is = isCL(P(0,0),r,p1,p2);
if(is.empty()) return r*r*rad(p1,p2)/2;
bool b1 = cmp(p1.abs2(),r*r) == 1, b2 = cmp(p2.abs2(), r*r) == 1;
if(b1 && b2){
P md=(is[0]+is[1])/2;
if(sign((p1-md).dot(p2-md)) <= 0)
return r*r*(rad(p1,is[0]) + rad(is[1],p2))/2 + is[0].det(is[1])/2;
else return r*r*rad(p1,p2)/2;
}
if(b1) return (r*r*rad(p1,is[0]) + is[0].det(p2))/2;
if(b2) return (p1.det(is[1]) + r*r*rad(is[1],p2))/2;
return p1.det(p2)/2;
}
struct L{ //ps[0] -> ps[1]
P ps[2];
P dir_;
P& operator[](int i) { return ps[i]; }
P dir() { return dir_; }
L (P a,P b) {
ps[0]=a;
ps[1]=b;
dir_ = (ps[1]-ps[0]).unit();
}
bool include(P p) { return sign((dir_).det(p - ps[0])) > 0; }
L push(){ // push eps outward
const double eps = 1e-8;
P delta = (ps[1] - ps[0]).rot90().unit() * eps;
return {ps[0] + delta, ps[1] + delta};
}
};
P isLL(L l1,L l2){ return isLL(l1[0],l1[1],l2[0],l2[1]); }
bool parallel(L l0, L l1) { return sign( l0.dir().det( l1.dir() ) ) == 0; }
bool sameDir(L l0, L l1) { return parallel(l0, l1) && sign(l0.dir().dot(l1.dir()) ) == 1; }
bool cmp (P a, P b) {
if (a.quad() != b.quad()) {
return a.quad() < b.quad();
} else {
return sign( a.det(b) ) > 0;
}
}
bool operator < (L l0, L l1) {
if (sameDir(l0, l1)) {
return l1.include(l0[0]);
} else {
return cmp( l0.dir(), l1.dir() );
}
}
bool check(L u, L v, L w) {
return w.include(isLL(u,v));
}
vector<P> halfPlaneIS(vector<L> &l) {
sort(l.begin(), l.end());
deque<L> q;
for (int i = 0; i < (int)l.size(); ++i) {
if (i && sameDir(l[i], l[i - 1])) continue;
while (q.size() > 1 && !check(q[q.size() - 2], q[q.size() - 1], l[i])) q.pop_back();
while (q.size() > 1 && !check(q[1], q[0], l[i])) q.pop_front();
q.push_back(l[i]);
}
while (q.size() > 2 && !check(q[q.size() - 2], q[q.size() - 1], q[0])) q.pop_back();
while (q.size() > 2 && !check(q[1], q[0], q[q.size() - 1])) q.pop_front();
vector<P> ret;
for (int i = 0; i < (int)q.size(); ++i) ret.push_back(isLL(q[i], q[(i + 1) % q.size()]));
return ret;
}
P inCenter(P A, P B, P C) {
double a = (B - C).abs(), b = (C - A).abs(), c = (A - B).abs();
return (A * a + B * b + C * c) / (a + b + c);
}
P circumCenter(P a, P b, P c) {
P bb = b - a, cc = c - a;
double db = bb.abs2(), dc = cc.abs2(), d = 2 * bb.det(cc);
return a - P(bb.y * dc - cc.y * db, cc.x * db - bb.x * dc) / d;
}
P othroCenter(P a, P b, P c) {
P ba = b - a, ca = c - a, bc = b - c;
double Y = ba.y * ca.y * bc.y,
A = ca.x * ba.y - ba.x * ca.y,
x0 = (Y + ca.x * ba.y * b.x - ba.x * ca.y * c.x) / A,
y0 = -ba.x * (x0 - c.x) / ba.y + ca.y;
return {x0, y0};
}
P p[10],q[10];
db h1,h2;
P o1,o2;
int main() {
p[0].read(); p[1].read(); cin>>h1;
p[2]=p[1]+(p[1]-p[0]).rot90(); p[3]=p[0]+p[2]-p[1];
o1=(p[0]+p[2])/2;
q[0].read(); q[1].read(); cin>>h2;
q[2]=q[1]+(q[1]-q[0]).rot90(); q[3]=q[0]+q[2]-q[1];
o2=(q[0]+q[2])/2;
db ans=1e30;
rep(i,0,4) rep(j,0,4) {
P p1=p[i],d1=(p[(i+1)%4]-p[i]);
P p2=q[j],d2=(q[(j+1)%4]-q[j]);
db fl=0,fr=1;
auto eval=[&](db f1) {
db gl=0,gr=1;
auto eval2=[&](db f1,db g1) {
P X=p1+d1*f1,Y=p2+d2*g1;
return sqrt((o1-X).abs2()+h1*h1)+sqrt((o2-Y).abs2()+h2*h2)+X.distTo(Y);
};
rep(r2,0,200) {
db gll=(gl*2+gr)/3,grr=(gl+gr*2)/3;
if (eval2(f1,gll)<eval2(f1,grr)) gr=grr; else gl=gll;
}
return eval2(f1,gl);
};
rep(r1,0,200) {
db fll=(fl*2+fr)/3,frr=(fl+fr*2)/3;
if (eval(fll)<eval(frr)) fr=frr; else fl=fll;
}
ans=min(ans,eval(fl));
}
printf("%.10f\n",ans);
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 35ms
memory: 3940kb
input:
1 0 0 0 10000 99999 10000 10000 10000 10000
output:
76118.7000492205
result:
ok found '76118.7000492', expected '76118.7000492', error '0.0000000'
Test #2:
score: 0
Accepted
time: 35ms
memory: 3996kb
input:
10000 10000 10000 0 10000 0 0 0 10000 10000
output:
32360.6797749979
result:
ok found '32360.6797750', expected '32360.6797750', error '0.0000000'
Test #3:
score: 0
Accepted
time: 35ms
memory: 3940kb
input:
0 0 100 100 20 0 0 -5 -5 2
output:
107.3655550790
result:
ok found '107.3655551', expected '107.3655551', error '0.0000000'
Test #4:
score: 0
Accepted
time: 35ms
memory: 3988kb
input:
0 0 100 100 20 23 23 18 18 2
output:
88.0567570506
result:
ok found '88.0567571', expected '88.0567571', error '0.0000000'
Test #5:
score: 0
Accepted
time: 35ms
memory: 3992kb
input:
0 0 100 100 20 100 100 105 95 2
output:
107.3655550790
result:
ok found '107.3655551', expected '107.3655551', error '0.0000000'
Test #6:
score: 0
Accepted
time: 31ms
memory: 3936kb
input:
0 0 100 100 20 44 156 49 151 2
output:
77.7045202177
result:
ok found '77.7045202', expected '77.7045202', error '0.0000000'
Test #7:
score: 0
Accepted
time: 35ms
memory: 3920kb
input:
0 0 100 100 20 200 0 205 5 2
output:
224.5280351568
result:
ok found '224.5280352', expected '224.5280352', error '0.0000000'
Test #8:
score: 0
Accepted
time: 35ms
memory: 3912kb
input:
0 0 100 100 20 -29 171 -24 176 2
output:
84.3681957983
result:
ok found '84.3681958', expected '84.3681958', error '0.0000000'
Test #9:
score: 0
Accepted
time: 35ms
memory: 3996kb
input:
0 0 100 100 20 -100 100 -105 105 2
output:
107.3655550790
result:
ok found '107.3655551', expected '107.3655551', error '0.0000000'
Test #10:
score: 0
Accepted
time: 35ms
memory: 3980kb
input:
0 0 100 100 20 -69 69 -74 74 2
output:
83.2946124444
result:
ok found '83.2946124', expected '83.2946124', error '0.0000000'
Test #11:
score: 0
Accepted
time: 31ms
memory: 4052kb
input:
0 0 30 0 20 50 20 80 20 20
output:
72.8010988928
result:
ok found '72.8010989', expected '72.8010989', error '0.0000000'
Test #12:
score: 0
Accepted
time: 35ms
memory: 3860kb
input:
0 0 30 0 20 50 20 80 20 140
output:
186.8749482758
result:
ok found '186.8749483', expected '186.8749483', error '0.0000000'
Test #13:
score: 0
Accepted
time: 35ms
memory: 3848kb
input:
0 0 30 0 140 50 20 80 20 140
output:
302.2649537612
result:
ok found '302.2649538', expected '302.2649538', error '0.0000000'
Test #14:
score: 0
Accepted
time: 35ms
memory: 3916kb
input:
0 0 30 0 500 50 20 80 20 140
output:
661.3287930050
result:
ok found '661.3287930', expected '661.3287930', error '0.0000000'
Test #15:
score: 0
Accepted
time: 35ms
memory: 3908kb
input:
0 0 30 0 500 50 20 80 20 500
output:
1020.6458719614
result:
ok found '1020.6458720', expected '1020.6458720', error '0.0000000'
Test #16:
score: 0
Accepted
time: 35ms
memory: 3920kb
input:
0 0 30 0 500 50 20 80 20 2000
output:
2520.3614737461
result:
ok found '2520.3614737', expected '2520.3614737', error '0.0000000'
Test #17:
score: 0
Accepted
time: 31ms
memory: 3964kb
input:
1137 -1096 229 -599 6253 5792 -405 3433 -9660 2912
output:
16631.2672046379
result:
ok found '16631.2672046', expected '16631.2672046', error '0.0000000'
Test #18:
score: 0
Accepted
time: 35ms
memory: 3908kb
input:
-1458 4365 -759 -5184 408 8891 -5111 2941 -8564 6966
output:
14848.0979672057
result:
ok found '14848.0979672', expected '14848.0979672', error '0.0000000'
Test #19:
score: 0
Accepted
time: 35ms
memory: 3960kb
input:
2289 1693 -2539 850 7414 -4989 3660 8091 2109 6915
output:
18844.4706205017
result:
ok found '18844.4706205', expected '18844.4706205', error '0.0000000'
Test #20:
score: 0
Accepted
time: 35ms
memory: 4056kb
input:
5431 8457 6717 -6624 2204 -5504 -5607 4032 -674 7792
output:
20847.8621668110
result:
ok found '20847.8621668', expected '20847.8621668', error '0.0000000'
Test #21:
score: 0
Accepted
time: 35ms
memory: 3968kb
input:
4274 -9998 -3313 -2647 4590 -792 1334 5701 -8048 3257
output:
16956.4834717883
result:
ok found '16956.4834718', expected '16956.4834718', error '0.0000000'
Test #22:
score: 0
Accepted
time: 31ms
memory: 3964kb
input:
-1563 -4648 1926 -2970 5843 -1600 9113 -1007 5823 7516
output:
19666.6200192504
result:
ok found '19666.6200193', expected '19666.6200193', error '0.0000000'
Test #23:
score: 0
Accepted
time: 35ms
memory: 3896kb
input:
-6957 -1204 -2026 2849 1571 9178 1160 -3263 -6525 9297
output:
22798.2691656400
result:
ok found '22798.2691656', expected '22798.2691656', error '0.0000000'
Test #24:
score: 0
Accepted
time: 35ms
memory: 3848kb
input:
-5254 4877 5836 -1945 4282 8106 -8783 7076 -2291 6168
output:
17820.1271048619
result:
ok found '17820.1271049', expected '17820.1271049', error '0.0000000'
Test #25:
score: 0
Accepted
time: 35ms
memory: 3856kb
input:
2278 -7979 -200 -9432 528 -8604 1343 -5214 2428 8005
output:
22690.4150723923
result:
ok found '22690.4150724', expected '22690.4150724', error '0.0000000'
Test #26:
score: 0
Accepted
time: 35ms
memory: 3964kb
input:
5003 277 737 -3626 2886 3492 4353 -446 5788 2426
output:
10058.3916191793
result:
ok found '10058.3916192', expected '10058.3916192', error '0.0000000'
Test #27:
score: 0
Accepted
time: 35ms
memory: 3940kb
input:
-6582 -2629 -1742 6935 5531 -2010 1455 1794 -3461 9066
output:
20018.3757266857
result:
ok found '20018.3757267', expected '20018.3757267', error '0.0000000'
Test #28:
score: 0
Accepted
time: 35ms
memory: 3940kb
input:
-8174 -1075 -6736 -2685 6615 -2151 4184 -1716 -308 5064
output:
16260.3532322230
result:
ok found '16260.3532322', expected '16260.3532322', error '0.0000000'
Test #29:
score: 0
Accepted
time: 35ms
memory: 3956kb
input:
5291 1243 8982 5204 8450 -1177 -5306 -1390 2460 8858
output:
23316.8500582544
result:
ok found '23316.8500583', expected '23316.8500583', error '0.0000000'
Test #30:
score: 0
Accepted
time: 31ms
memory: 3964kb
input:
-4229 2060 9017 -2659 5812 9887 -9973 5460 -2671 4205
output:
18310.3049215940
result:
ok found '18310.3049216', expected '18310.3049216', error '0.0000000'
Test #31:
score: 0
Accepted
time: 31ms
memory: 3908kb
input:
0 0 8 0 3 0 8 8 8 3
output:
10.0000000000
result:
ok found '10.0000000', expected '10.0000000', error '0.0000000'
Test #32:
score: 0
Accepted
time: 35ms
memory: 3916kb
input:
0 0 8 0 2 8 8 16 8 2
output:
12.0000000000
result:
ok found '12.0000000', expected '12.0000000', error '0.0000000'
Test #33:
score: 0
Accepted
time: 35ms
memory: 3992kb
input:
0 0 8 0 2 10 10 18 10 2
output:
14.8284271247
result:
ok found '14.8284271', expected '14.8284271', error '0.0000000'
Test #34:
score: 0
Accepted
time: 35ms
memory: 3988kb
input:
0 0 8 0 100000 10 10 18 10 100000
output:
200002.8287471247
result:
ok found '200002.8287471', expected '200002.8287471', error '0.0000000'
Test #35:
score: 0
Accepted
time: 35ms
memory: 3904kb
input:
51412 80788 39091 71527 97605 6327 44899 20415 -12571 86627
output:
194757.4868334289
result:
ok found '194757.4868334', expected '194757.4868334', error '0.0000000'
Test #36:
score: 0
Accepted
time: 35ms
memory: 3964kb
input:
-43347 56743 17244 83573 86143 -90081 -3018 -22063 -95528 26489
output:
179973.3418451778
result:
ok found '179973.3418452', expected '179973.3418452', error '0.0000000'
Test #37:
score: 0
Accepted
time: 35ms
memory: 4056kb
input:
88637 -28248 308 -92620 47395 -57673 62668 -66785 923 49207
output:
210116.8218173325
result:
ok found '210116.8218173', expected '210116.8218173', error '0.0000000'
Test #38:
score: 0
Accepted
time: 31ms
memory: 3996kb
input:
59768 12643 57116 -71451 64957 -43638 42191 -37837 9851 1875
output:
171578.6515053421
result:
ok found '171578.6515053', expected '171578.6515053', error '0.0000000'
Test #39:
score: 0
Accepted
time: 35ms
memory: 3996kb
input:
-46206 -30845 -28470 3652 33497 74620 -92045 75046 -19320 48537
output:
147174.1317146147
result:
ok found '147174.1317146', expected '147174.1317146', error '0.0000000'
Test #40:
score: 0
Accepted
time: 35ms
memory: 3916kb
input:
65899 65734 27624 70256 81635 -97389 -56422 -91684 -53179 88643
output:
317109.4217967594
result:
ok found '317109.4217968', expected '317109.4217968', error '0.0000000'
Test #41:
score: 0
Accepted
time: 35ms
memory: 3920kb
input:
-25117 -50391 569 -34721 73972 -90107 -83510 -46359 -95477 83257
output:
174084.6702541819
result:
ok found '174084.6702542', expected '174084.6702542', error '0.0000000'
Test #42:
score: 0
Accepted
time: 35ms
memory: 4060kb
input:
6832 -56636 7968 -59867 82961 6289 -49692 -56413 -38910 90946
output:
184208.6118875315
result:
ok found '184208.6118875', expected '184208.6118875', error '0.0000000'
Test #43:
score: 0
Accepted
time: 35ms
memory: 3984kb
input:
-100000 -100000 -100000 100000 100000 100000 100000 100000 -100000 100000
output:
482842.7124746190
result:
ok found '482842.7124746', expected '482842.7124746', error '0.0000000'
Test #44:
score: 0
Accepted
time: 35ms
memory: 4048kb
input:
-79878 -52149 -90171 -65032 95613 -22921 39940 69440 26987 94207
output:
319596.9717576302
result:
ok found '319596.9717576', expected '319596.9717576', error '0.0000000'
Extra Test:
score: 0
Extra Test Passed