QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#326268 | #4886. Best Sun | zhouhuanyi | AC ✓ | 586ms | 15988kb | C++14 | 5.2kb | 2024-02-12 19:11:56 | 2024-02-12 19:11:56 |
Judging History
answer
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<cstdlib>
#include<random>
#define N 301
#define M 100000
using namespace std;
mt19937 RAND(random_device{}());
const double Pi=asin(1)*2;
const double inf=1e6;
const double INF=1e25;
const double eps=1e-9;
int read()
{
char c=0;
int sum=0,f=1;
while (c!='-'&&(c<'0'||c>'9')) c=getchar();
if (c=='-') c=getchar(),f=-1;
while ('0'<=c&&c<='9') sum=sum*10+c-'0',c=getchar();
return sum*f;
}
struct points
{
int x,y;
bool operator < (const points &t)const
{
return y!=t.y?y<t.y:x<t.x;
}
};
points zero,ds,st[N+1];
points operator + (points a,points b)
{
return (points){a.x+b.x,a.y+b.y};
}
points operator - (points a,points b)
{
return (points){a.x-b.x,a.y-b.y};
}
long long operator * (points a,points b)
{
return 1ll*a.x*b.y-1ll*a.y*b.x;
}
struct reads
{
int x,y;
points d;
double ds;
bool operator < (const reads &t)const
{
return ds<t.ds;
}
};
reads tong[M+1];
struct rds
{
int num,cl;
double data;
bool operator < (const rds &t)const
{
return abs(data-t.data)>eps?data<t.data:cl<t.cl;
}
};
double ans,arcd[N+1][N+1],dp[M+1],DP[N+1],arc[N+1],delta[N+1][N+1],w[M+1],sdelta[N+1][N+1],sdelta2[N+1][N+1];
int T,n,length,p[N+1],P[N+1],num[N+1][N+1];
long long dst[N+1][N+1];
bool used[N+1][N+1];
vector<rds>v[N+1];
bool checks(points a,points b,points c)
{
return (b-a)*(c-a)>=0;
}
double MD(double x)
{
if (x>=2*Pi) x-=2*Pi;
if (x<0) x+=2*Pi;
return x;
}
double calc(points a)
{
if (a.x>0) return MD(atan(1.0*a.y/a.x));
else if (a.x==0) return a.y>0?Pi/2:3*Pi/2;
else return MD(atan(1.0*a.y/a.x)+Pi);
}
double calc2(points a)
{
return MD(calc(a)-3*Pi/2);
}
void adder(int x,int y,double ds,double d)
{
DP[x]=max(DP[x],ds+sdelta2[x][y]*d);
return;
}
double query(int x,int y,double d)
{
return DP[x]-sdelta[x][y]*d;
}
bool check_line(double x,double y,double z)
{
if (x<=z) return x<=y&&y<=z;
else return x<=y||y<=z;
}
bool cmp(int x,int y)
{
return arc[x]<arc[y];
}
bool check(int x,double d)
{
if (x==n-1||x==n) return 0;
double sw,res=0,rst,minn;
ds=st[x];
for (int i=1;i<=n;++i)
for (int j=1;j<=n;++j)
used[i][j]=0;
for (int i=1;i<=n;++i) DP[i]=-INF;
for (int i=x+1;i<=n;++i) P[i]=i,arc[i]=arcd[x][i];
sort(P+x+1,P+n+1,cmp);
for (int i=x+1;i<=n;++i)
{
minn=INF;
for (int j=i+1;j<=n;++j)
if (MD(arcd[P[i]][x]-arcd[P[i]][P[j]])<minn)
minn=MD(arcd[P[i]][x]-arcd[P[i]][P[j]]),used[P[i]][P[j]]=used[P[j]][P[i]]=1;
}
for (int i=x+1;i<=n;++i) used[x][i]=used[i][x]=1;
for (int i=1;i<=length;++i)
if (tong[i].x>=x&&tong[i].y>=x&&used[tong[i].x][tong[i].y])
{
rst=abs((st[tong[i].x]-st[x])*(st[tong[i].y]-st[x])/2.0),dp[i]=rst+query(tong[i].x,tong[i].y,d)-w[i]*d;
if (tong[i].x==x)
{
if (tong[i].ds>=0)
{
sw=MD(tong[i].ds-Pi/2-eps),res=0;
if (tong[i].ds>0)
{
for (int j=0;j<v[x].size();++j)
if (v[x][j].num!=tong[i].x&&v[x][j].num!=tong[i].y&&v[x][j].cl==1&&check_line(3*Pi/2,arcd[x][v[x][j].num],sw))
res+=delta[x][v[x][j].num];
}
dp[i]=max(dp[i],rst-(res+w[i])*d);
}
}
adder(tong[i].y,tong[i].x,dp[i],d);
if (tong[i].y==x)
{
if (tong[i].ds>=0)
{
sw=MD(tong[i].ds-Pi/2+eps),res=0;
for (int j=0;j<v[x].size();++j)
if (v[x][j].num!=tong[i].x&&v[x][j].num!=tong[i].y&&v[x][j].cl==1&&check_line(sw,arcd[x][v[x][j].num],3*Pi/2-eps))
res+=delta[x][v[x][j].num];
if (dp[i]-res*d>0) return 1;
}
}
}
return 0;
}
int main()
{
double l,r,mid,rest;
T=read();
while (T--)
{
n=read(),length=ans=0;
for (int i=1;i<=n;++i) st[i].x=read(),st[i].y=read(),p[i]=i,v[i].clear();
sort(st+1,st+n+1);
for (int i=1;i<=n;++i)
for (int j=1;j<=n;++j)
{
dst[i][j]=1ll*(st[i].x-st[j].x)*(st[i].x-st[j].x)+1ll*(st[i].y-st[j].y)*(st[i].y-st[j].y),delta[i][j]=sqrt(dst[i][j]),arcd[i][j]=calc(st[j]-st[i]);
if (i!=j) v[i].push_back((rds){j,1,calc2(st[j]-st[i])}),v[i].push_back((rds){j,0,MD(calc2(st[j]-st[i])-Pi/2)}),v[i].push_back((rds){j,2,MD(calc2(st[j]-st[i])+Pi/2)});
}
for (int i=1;i<=n;++i)
{
sort(v[i].begin(),v[i].end()),rest=0;
for (int j=0;j<v[i].size();++j)
{
if (v[i][j].cl==1) rest+=delta[i][v[i][j].num];
else if (!v[i][j].cl) sdelta[i][v[i][j].num]=rest;
else sdelta2[i][v[i][j].num]=rest;
}
}
for (int i=1;i<=n;++i)
for (int j=1;j<=n;++j)
if (i!=j)
tong[++length]=(reads){i,j,st[j]-st[i],calc(st[j]-st[i])};
sort(tong+1,tong+length+1);
for (int i=1;i<=length;++i)
{
w[i]=delta[tong[i].x][tong[i].y];
for (int j=1;j<=n;++j)
if (checks(st[tong[i].x],st[j],st[tong[i].y])&&dst[tong[i].x][j]+dst[tong[i].x][tong[i].y]>=dst[tong[i].y][j]&&dst[tong[i].y][j]+dst[tong[i].x][tong[i].y]>=dst[tong[i].x][j])
w[i]+=min(delta[tong[i].x][j],delta[tong[i].y][j]);
}
shuffle(p+1,p+n+1,RAND);
for (int i=1;i<=n;++i)
if (check(p[i],ans+eps))
{
l=ans,r=inf;
for (int j=1;j<=40;++j)
{
mid=(l+r)/2;
if (check(p[i],mid)) l=mid;
else r=mid;
}
ans=(l+r)/2;
}
printf("%0.12lf\n",ans);
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 4200kb
input:
4 3 -1 -1 1 -1 0 1 4 0 0 10 0 0 10 8 1 5 2 0 -2 0 1 1 -1 1 0 3 8 4 4 -4 4 4 -4 -4 -4 5 6 -6 5 -5 -6 6 -5
output:
0.309016741085 1.236861407961 0.271137172722 1.563100664058
result:
ok 4 numbers
Test #2:
score: 0
Accepted
time: 51ms
memory: 4132kb
input:
10000 3 702262 828158 -350821 -420883 -466450 13507 3 28647 -193498 126436 -864937 -287798 738936 3 270358 -269567 745815 -485408 834083 677952 3 -2036 -403634 742978 -263774 975937 -609237 3 584248 -472620 482016 -356760 284902 903881 3 -292004 504925 -935756 373793 -781101 -434659 3 -858513 684433...
output:
85789.087398097763 18268.519361754443 102489.988390061626 66685.754427908250 18674.657937026495 106468.965131625737 14427.024651467946 29966.245302148309 143547.751083588082 13097.175688471907 162410.168316910131 72070.932418228040 29369.992628289765 52867.294431507617 90314.308346478356 99775.92719...
result:
ok 10000 numbers
Test #3:
score: 0
Accepted
time: 42ms
memory: 4292kb
input:
10000 3 2 2 2 -2 -5 -5 3 -3 5 5 -4 2 -2 3 -4 1 2 -2 -4 4 3 1 -4 2 1 -4 1 3 2 1 -1 1 -3 3 3 4 5 3 -1 -3 -3 3 1 5 5 0 5 -1 3 2 -3 -5 -3 5 3 3 -4 4 0 -5 5 4 3 2 -3 5 0 2 -5 3 -2 -3 5 -3 5 4 3 -1 4 4 4 4 3 3 5 3 -1 4 2 -1 3 2 -3 4 3 -4 3 3 0 4 -2 -2 -1 -3 3 -2 0 -4 -2 4 2 3 -3 -1 3 1 1 -3 3 2 -5 2 3 -4 ...
output:
0.650700258120 0.226809333981 0.494682808494 0.825532424642 0.267532868747 0.737928075978 0.136853032018 0.827746134746 1.389628323523 0.248476226261 1.025126493914 0.225245003094 0.798168457550 1.052177594829 0.270090367849 0.221027676162 0.654929408483 1.065792730515 0.120735876408 0.172720774572 ...
result:
ok 10000 numbers
Test #4:
score: 0
Accepted
time: 64ms
memory: 4392kb
input:
5625 4 -405394 -381883 602267 -335687 -620806 984110 271283 531233 4 196903 -993060 290851 358123 -890076 -717709 -681138 209884 4 -849589 607722 -21517 -586295 208561 -220953 924518 622983 4 -832186 456270 289934 43656 636006 339718 188963 113907 4 -305762 -872205 -520125 368722 -774548 984204 4245...
output:
232625.004274515260 268175.826986296219 159589.323630752886 60440.753042257711 133893.123436211899 63201.990748247728 167697.663405938540 129470.013284390006 126903.854072912625 106643.971263388783 131692.311227652681 100421.055015939113 148490.274817504542 68842.242309528956 241376.191116151167 303...
result:
ok 5625 numbers
Test #5:
score: 0
Accepted
time: 60ms
memory: 4444kb
input:
5625 4 -2 -1 4 -5 -2 -4 -4 -4 4 -1 -5 4 4 2 -5 -5 1 4 -3 -4 -3 -1 -5 -1 4 -2 4 -2 4 -4 1 -1 -1 5 -4 4 -3 -5 -1 4 5 -1 3 5 4 -4 -2 1 4 -1 1 3 4 4 -5 3 -3 3 5 -4 -1 4 4 1 2 2 -5 1 0 0 -3 4 -5 -4 2 -3 5 3 -3 2 4 2 -2 -4 3 1 -4 -5 -5 4 -3 5 -2 4 1 3 1 -4 4 0 -5 5 -5 0 -2 -3 2 4 0 5 -1 -4 -2 0 4 -1 4 4 -...
output:
0.491968362791 1.608024352000 0.676463940274 0.814682445969 1.572795030987 0.202044702746 0.442366854259 0.305582926329 1.508906622187 1.322787857140 0.521856207812 0.398280423836 1.219494606630 1.177491611809 1.395102572133 1.073773546523 0.754090110201 0.607558773951 1.437319497199 0.967112555372 ...
result:
ok 5625 numbers
Test #6:
score: 0
Accepted
time: 76ms
memory: 4164kb
input:
3600 5 114127 146710 467065 -311758 189643 449065 -303893 -215009 -789281 -140748 5 -449893 654165 -899120 -560520 719351 652759 285007 471281 987628 -767128 5 -587522 89736 -355416 -178001 801765 512722 314119 -136906 350051 762194 5 85697 920768 161507 -533920 -536515 401333 -27632 -987465 112237 ...
output:
84655.199548975652 270848.726867360878 202824.036734000401 135615.191873966978 119666.508543629054 89811.870771031536 254983.153574888565 189662.747266538645 64951.657089574721 154748.442290858773 214519.682078844198 163467.532800589135 278857.257440727204 191490.497905443917 172625.529643028131 144...
result:
ok 3600 numbers
Test #7:
score: 0
Accepted
time: 73ms
memory: 4160kb
input:
3600 5 2 6 -6 4 4 0 -5 0 3 1 5 0 3 5 -5 2 6 4 0 2 -4 5 2 -2 -6 -3 -5 -5 -1 3 -4 0 5 0 6 -3 -5 5 1 4 -3 -5 6 5 0 -6 -6 -5 -2 6 1 6 2 0 5 2 1 6 5 4 -1 -3 -2 -6 4 5 -1 -2 5 -6 -1 4 -2 3 6 4 5 -6 3 6 -5 4 -4 3 -1 2 -6 5 5 -4 1 -5 1 0 5 -1 3 2 5 -4 6 2 -4 1 -4 5 5 -1 6 5 -3 0 0 6 -2 5 -5 5 2 6 5 2 -1 -4 ...
output:
1.391734132786 1.060007434717 1.338660331223 2.178641545292 1.867763339805 1.255064095880 1.819705896231 0.946302646698 1.131643010045 1.577239088494 0.521212263499 1.537179286970 0.947338321566 1.047091108145 0.557230053037 1.208597130719 1.230289399246 0.667574491866 0.366505901184 0.694342697519 ...
result:
ok 3600 numbers
Test #8:
score: 0
Accepted
time: 79ms
memory: 4144kb
input:
3600 5 -3 1 0 -1 2 -3 4 1 5 0 5 -3 -5 1 -5 -2 -2 3 2 1 5 5 -4 -2 4 5 5 3 2 -4 -4 0 5 0 4 -5 3 1 4 -1 1 4 1 5 5 -3 2 -5 -3 -4 -1 1 5 1 5 -5 5 -2 1 -3 2 2 2 -4 5 5 -2 -3 -1 3 1 1 3 -2 -2 -2 5 2 1 -2 -3 -3 -3 5 0 -5 4 5 2 2 -2 5 5 -1 4 -5 -2 4 5 -4 5 -1 -3 -2 5 5 -1 -4 3 5 -5 -4 -1 -3 0 -1 -5 1 -4 -3 5...
output:
0.543380792806 1.207931511320 1.575494479766 0.807518498297 1.556679762871 0.682448899170 0.907439698494 0.950838822084 0.853771325637 1.371308371745 0.742640490859 0.401491852733 0.747427748138 0.493469542562 0.711214245480 0.609299551013 1.234435785591 0.433814875578 1.467933088861 0.695462858857 ...
result:
ok 3600 numbers
Test #9:
score: 0
Accepted
time: 74ms
memory: 4360kb
input:
3600 5 0 2 3 -7 7 3 -6 -1 6 -6 5 -3 6 -5 6 -10 -2 -4 -8 -9 8 5 -2 2 2 -9 6 -3 2 10 -5 7 5 -7 9 9 -4 -8 -2 4 10 9 -8 5 -8 -5 -10 0 -7 0 0 -7 6 8 5 10 -7 8 -8 3 1 0 -4 -7 -4 5 2 -9 -3 1 -4 -2 -3 -3 0 1 5 -8 5 -10 6 2 -8 6 -5 -6 8 5 5 8 -8 -9 3 -7 -9 0 -4 3 5 2 -5 2 0 6 7 10 5 -8 -6 5 -10 -2 7 -6 -10 5...
output:
2.105200477407 1.536769104860 1.607020540978 3.526347657891 1.978433374461 1.082518575528 0.946163491860 1.602327301953 2.883772436418 0.940815162816 1.701362257390 1.600920207759 1.933487488068 0.691865807312 1.833983939339 0.630647718936 3.433951556275 2.448706709401 1.551665849247 1.145489185405 ...
result:
ok 3600 numbers
Test #10:
score: 0
Accepted
time: 98ms
memory: 4260kb
input:
900 10 -10 -1 8 -6 7 -1 -5 8 -7 -9 4 -2 -9 10 -10 -8 9 9 -3 -6 10 -5 9 -7 -1 -9 -7 -4 6 -5 2 1 -4 10 8 -9 -9 2 0 7 7 10 -3 -7 9 -4 -5 2 1 1 6 7 -4 7 4 -6 0 1 -8 -5 3 -5 10 -3 -10 -8 -7 -5 -5 -6 3 -3 -1 7 -9 1 -5 9 -7 -2 3 -4 9 10 0 1 -3 8 -3 7 4 -10 10 -6 -5 -8 10 4 4 3 0 -8 3 -10 10 4 -5 2 0 -5 -10...
output:
2.606027915118 1.263341638103 1.183899004622 0.882728727447 1.878227236560 1.569813944006 1.553295621983 1.632832784862 1.573799181642 0.997096082247 0.942482792816 1.417282736477 1.401766180745 1.693986705304 2.862877700862 2.055359774035 2.208777157800 1.320239334746 1.505864820431 1.595800441628 ...
result:
ok 900 numbers
Test #11:
score: 0
Accepted
time: 102ms
memory: 4340kb
input:
900 10 670067 394291 -797310 -637136 -435933 -923795 120936 309795 -934569 -688829 950758 634654 983083 900196 174829 181896 -191047 177910 258020 672165 10 424046 -657491 391198 -14995 -302986 -597011 -96387 -486090 -164032 -356501 -891789 12548 -703186 -924511 808215 -212606 659523 490088 738901 5...
output:
81290.161837961467 91483.733196303423 100154.027056051680 192606.414820457168 177441.647434583632 76150.892372329618 177358.705374143610 230115.879266851029 280209.262845323654 61218.543020907819 137504.791638134688 168344.544041219197 162167.181815044605 133102.529269482824 177087.456345555809 1635...
result:
ok 900 numbers
Test #12:
score: 0
Accepted
time: 128ms
memory: 4372kb
input:
225 20 -4 -9 -5 3 7 -10 10 7 2 7 1 4 2 2 -5 -1 -9 -1 -3 10 -8 -6 0 -5 7 -4 -6 -8 -7 -5 -1 -7 -1 -3 8 -6 6 3 8 2 20 8 2 6 -8 -3 -6 -2 9 5 -2 0 8 8 0 -7 -9 3 1 4 -10 4 7 -6 -1 -8 -7 2 -8 -8 -1 1 -9 2 -10 1 2 -7 8 -10 3 20 5 8 0 -3 9 -9 -10 -4 -10 -2 9 10 -2 8 -6 -10 6 -6 -3 7 5 10 7 7 -5 -6 -2 3 -4 0 ...
output:
0.612786975387 1.113790548603 0.761536150614 1.330805844191 0.754049674612 1.332837684353 0.670314367531 1.035312542675 0.906817409450 0.976967091989 0.750284745227 0.778031656463 0.717904483944 0.571580463357 0.772105828165 0.769290924956 1.890445989241 0.860096328445 1.077733598591 1.312980845829 ...
result:
ok 225 numbers
Test #13:
score: 0
Accepted
time: 126ms
memory: 4540kb
input:
225 20 983700 -466859 -20884 -364855 807044 -308568 -785298 910840 -61173 -276993 -872226 -878552 -235162 831941 978289 938037 585612 -598517 545857 403231 -450887 -558997 -293044 -675226 -900628 102932 -836719 -530135 -534412 -681687 -487340 -227869 161252 -557533 397943 464720 170537 68556 413322 ...
output:
103902.052600136551 185063.038457055402 60443.657372378606 118360.364609987490 157018.785130463250 103511.465806239197 65549.699479608680 67043.358829033765 105010.270532959068 93450.057668629015 96005.228207717955 54350.098601577512 134718.535343371099 98397.354570352036 71213.294966764792 77465.39...
result:
ok 225 numbers
Test #14:
score: 0
Accepted
time: 34ms
memory: 5032kb
input:
6 50 -107573 -479674 -523931 117259 705403 519626 -802569 -162243 510741 876735 206326 -333274 448335 -276206 482965 -837837 873180 -965235 -359525 608790 -53827 782310 689038 -718590 739597 111296 420387 -953079 -492679 -243600 -929509 1174 800731 -968797 208236 193620 249265 499134 848153 771472 5...
output:
20480.382854264066 21190.022149731383 27821.672596065069 28113.319340415779 27223.967607496874 31857.835710179999
result:
ok 6 numbers
Test #15:
score: 0
Accepted
time: 161ms
memory: 5280kb
input:
36 50 569818 -279771 972561 928848 383 744221 -453534 -154445 293032 502859 744851 436690 293077 503053 657 744258 317135 -276665 293067 502799 277103 -439313 282010 -387735 276848 -439025 972274 928763 -110443 -507380 744799 436605 282061 -387926 -453689 -154326 317468 -276534 -453630 -154510 28193...
output:
81019.427454128992 77527.258773051697 55029.246423284079 42253.154385439542 72715.857822868900 197374.630740892200 37469.722581996328 66130.352995004941 54454.597806169753 125611.088368555589 71800.206272860043 87529.336768490029 143932.887614506530 95010.134681718671 86801.347938629478 106229.48886...
result:
ok 36 numbers
Test #16:
score: 0
Accepted
time: 158ms
memory: 5036kb
input:
36 50 -767165 583573 -284890 -681002 -423448 -259226 -285077 -680913 -921552 -557651 -767105 583853 -423314 -259380 790075 -225214 -921537 -557431 -767305 583770 -767124 583508 -921629 -557448 -423530 -259463 -284954 -680837 -423426 -259294 -423469 -259099 -767302 583744 -921772 -557672 -423503 -259...
output:
36643.605480260594 73491.058058035822 355454.440212807094 76283.491515744172 114070.220777054186 102751.942339871675 346834.508596344851 142611.057937938953 246800.067113708472 131055.886666592211 22279.887989367289 215589.657625024003 83424.868814001544 51800.234543215251 43278.861687825760 278223....
result:
ok 36 numbers
Test #17:
score: 0
Accepted
time: 141ms
memory: 5008kb
input:
36 50 -757926 470127 -757550 470454 250422 -395772 250548 -395869 568164 -704082 250417 -396082 -757845 470427 444672 170989 250387 -395875 250484 -395866 568177 -704202 -757558 470484 250530 -395763 250488 -395883 -757754 470201 250529 -396062 -757760 470255 568050 -704413 444991 171218 444963 1710...
output:
41461.415731205867 61470.345902207104 198910.999967218115 35019.368645523900 139342.579708221281 26339.662839022538 247086.679249133187 108103.832978720806 269038.970057237777 40491.226763766812 99838.873958486423 174035.149736784748 172811.211971052515 155604.880301536003 30013.670597455479 250614....
result:
ok 36 numbers
Test #18:
score: 0
Accepted
time: 187ms
memory: 6128kb
input:
9 100 -79487 826724 571284 354748 -312616 727781 -838024 249391 -79475 826592 796988 -514208 -847898 -839919 584481 896431 -847899 -839656 -312680 727782 22798 138363 466409 -215121 -36729 -925283 677267 -733543 -789119 581936 -789111 581860 271104 629366 571356 354824 -946155 -832752 571238 354954 ...
output:
23149.750595308447 20131.169120683633 50752.303675261021 22743.251242549242 21418.019942498031 24609.132975248380 20676.575271007336 23043.755914783753 35012.220302771471
result:
ok 9 numbers
Test #19:
score: 0
Accepted
time: 0ms
memory: 4452kb
input:
1 10 2 -999 3 -998 4 -995 5 -990 6 -983 7 -974 8 -963 9 -950 1000 1000 -1000 1000
output:
293.827109080962
result:
ok found '293.8271091', expected '293.8271087', error '0.0000000'
Test #20:
score: 0
Accepted
time: 388ms
memory: 15836kb
input:
1 300 -1000000 700000 -999999 697990 -999998 695960 -999997 693910 -999996 691840 -999995 689750 -999994 687640 -999993 685510 -999992 683360 -999991 681190 -999990 679000 -999989 676790 -999988 674560 -999987 672310 -999986 670040 -999985 667750 -999984 665440 -999983 663110 -999982 660760 -999981 ...
output:
46.717945145757
result:
ok found '46.7179451', expected '46.7179454', error '0.0000000'
Test #21:
score: 0
Accepted
time: 473ms
memory: 15928kb
input:
1 300 -9999 -2 -9998 -3 -9995 -4 -9990 -5 -9983 -6 -9974 -7 -9963 -8 -9950 -9 -9935 -10 -9918 -11 -9899 -12 -9878 -13 -9855 -14 -9830 -15 -9803 -16 -9774 -17 -9743 -18 -9710 -19 -9675 -20 -9638 -21 -9599 -22 -9558 -23 -9515 -24 -9470 -25 -9423 -26 -9374 -27 -9323 -28 -9270 -29 -9215 -30 -9158 -31 -9...
output:
2367.692137642536
result:
ok found '2367.6921376', expected '2367.6921380', error '0.0000000'
Test #22:
score: 0
Accepted
time: 408ms
memory: 15832kb
input:
1 300 700000 1000000 697990 999999 695960 999998 693910 999997 691840 999996 689750 999995 687640 999994 685510 999993 683360 999992 681190 999991 679000 999990 676790 999989 674560 999988 672310 999987 670040 999986 667750 999985 665440 999984 663110 999983 660760 999982 658390 999981 656000 999980...
output:
46.717945119048
result:
ok found '46.7179451', expected '46.7179454', error '0.0000000'
Test #23:
score: 0
Accepted
time: 471ms
memory: 15756kb
input:
1 300 -2 9999 -3 9998 -4 9995 -5 9990 -6 9983 -7 9974 -8 9963 -9 9950 -10 9935 -11 9918 -12 9899 -13 9878 -14 9855 -15 9830 -16 9803 -17 9774 -18 9743 -19 9710 -20 9675 -21 9638 -22 9599 -23 9558 -24 9515 -25 9470 -26 9423 -27 9374 -28 9323 -29 9270 -30 9215 -31 9158 -32 9099 -33 9038 -34 8975 -35 8...
output:
2367.692137999933
result:
ok found '2367.6921380', expected '2367.6921380', error '0.0000000'
Test #24:
score: 0
Accepted
time: 426ms
memory: 15856kb
input:
1 300 1000000 -700000 999999 -697990 999998 -695960 999997 -693910 999996 -691840 999995 -689750 999994 -687640 999993 -685510 999992 -683360 999991 -681190 999990 -679000 999989 -676790 999988 -674560 999987 -672310 999986 -670040 999985 -667750 999984 -665440 999983 -663110 999982 -660760 999981 -...
output:
46.717945085934
result:
ok found '46.7179451', expected '46.7179454', error '0.0000000'
Test #25:
score: 0
Accepted
time: 434ms
memory: 15684kb
input:
1 300 9999 2 9998 3 9995 4 9990 5 9983 6 9974 7 9963 8 9950 9 9935 10 9918 11 9899 12 9878 13 9855 14 9830 15 9803 16 9774 17 9743 18 9710 19 9675 20 9638 21 9599 22 9558 23 9515 24 9470 25 9423 26 9374 27 9323 28 9270 29 9215 30 9158 31 9099 32 9038 33 8975 34 8910 35 8843 36 8774 37 8703 38 8630 3...
output:
2367.692137586535
result:
ok found '2367.6921376', expected '2367.6921380', error '0.0000000'
Test #26:
score: 0
Accepted
time: 296ms
memory: 15932kb
input:
1 300 -700000 -1000000 -697990 -999999 -695960 -999998 -693910 -999997 -691840 -999996 -689750 -999995 -687640 -999994 -685510 -999993 -683360 -999992 -681190 -999991 -679000 -999990 -676790 -999989 -674560 -999988 -672310 -999987 -670040 -999986 -667750 -999985 -665440 -999984 -663110 -999983 -6607...
output:
46.717945121283
result:
ok found '46.7179451', expected '46.7179454', error '0.0000000'
Test #27:
score: 0
Accepted
time: 388ms
memory: 15664kb
input:
1 300 2 -999999 3 -999998 4 -999995 5 -999990 6 -999983 7 -999974 8 -999963 9 -999950 10 -999935 11 -999918 12 -999899 13 -999878 14 -999855 15 -999830 16 -999803 17 -999774 18 -999743 19 -999710 20 -999675 21 -999638 22 -999599 23 -999558 24 -999515 25 -999470 26 -999423 27 -999374 28 -999323 29 -9...
output:
24.916064222892
result:
ok found '24.9160642', expected '24.9160641', error '0.0000000'
Test #28:
score: 0
Accepted
time: 419ms
memory: 15636kb
input:
1 300 2 -44999 3 -44998 4 -44995 5 -44990 6 -44983 7 -44974 8 -44963 9 -44950 10 -44935 11 -44918 12 -44899 13 -44878 14 -44855 15 -44830 16 -44803 17 -44774 18 -44743 19 -44710 20 -44675 21 -44638 22 -44599 23 -44558 24 -44515 25 -44470 26 -44423 27 -44374 28 -44323 29 -44270 30 -44215 31 -44158 32...
output:
479.302066044040
result:
ok found '479.3020660', expected '479.3020661', error '0.0000000'
Test #29:
score: 0
Accepted
time: 350ms
memory: 15984kb
input:
1 300 2 -9999 3 -9998 4 -9995 5 -9990 6 -9983 7 -9974 8 -9963 9 -9950 10 -9935 11 -9918 12 -9899 13 -9878 14 -9855 15 -9830 16 -9803 17 -9774 18 -9743 19 -9710 20 -9675 21 -9638 22 -9599 23 -9558 24 -9515 25 -9470 26 -9423 27 -9374 28 -9323 29 -9270 30 -9215 31 -9158 32 -9099 33 -9038 34 -8975 35 -8...
output:
2367.692137574533
result:
ok found '2367.6921376', expected '2367.6921380', error '0.0000000'
Test #30:
score: 0
Accepted
time: 370ms
memory: 15636kb
input:
1 300 2 -49999 3 -49998 4 -49995 5 -49990 6 -49983 7 -49974 8 -49963 9 -49950 10 -49935 11 -49918 12 -49899 13 -49878 14 -49855 15 -49830 16 -49803 17 -49774 18 -49743 19 -49710 20 -49675 21 -49638 22 -49599 23 -49558 24 -49515 25 -49470 26 -49423 27 -49374 28 -49323 29 -49270 30 -49215 31 -49158 32...
output:
7347.578773968648
result:
ok found '7347.5787740', expected '7347.5787737', error '0.0000000'
Test #31:
score: 0
Accepted
time: 487ms
memory: 15688kb
input:
1 300 2 -99999 3 -99998 4 -99995 5 -99990 6 -99983 7 -99974 8 -99963 9 -99950 10 -99935 11 -99918 12 -99899 13 -99878 14 -99855 15 -99830 16 -99803 17 -99774 18 -99743 19 -99710 20 -99675 21 -99638 22 -99599 23 -99558 24 -99515 25 -99470 26 -99423 27 -99374 28 -99323 29 -99270 30 -99215 31 -99158 32...
output:
7264.823549044089
result:
ok found '7264.8235490', expected '7264.8235487', error '0.0000000'
Test #32:
score: 0
Accepted
time: 411ms
memory: 15824kb
input:
1 300 2 -999999 3 -999998 4 -999995 5 -999990 6 -999983 7 -999974 8 -999963 9 -999950 10 -999935 11 -999918 12 -999899 13 -999878 14 -999855 15 -999830 16 -999803 17 -999774 18 -999743 19 -999710 20 -999675 21 -999638 22 -999599 23 -999558 24 -999515 25 -999470 26 -999423 27 -999374 28 -999323 29 -9...
output:
80244.513740875031
result:
ok found '80244.5137409', expected '80244.5137404', error '0.0000000'
Test #33:
score: 0
Accepted
time: 586ms
memory: 15832kb
input:
1 300 -582688 -338066 65950 664506 726195 -342195 778617 -357210 -854288 556277 300499 294357 643715 884595 145808 699895 823594 197029 -326906 -938477 -635849 -984773 -133686 656789 -435448 690719 903384 -472986 82595 315750 -162788 541714 -77694 -237304 -850565 -426412 248922 -808508 -719332 -6663...
output:
1478.830055984710
result:
ok found '1478.8300560', expected '1478.8300559', error '0.0000000'
Test #34:
score: 0
Accepted
time: 355ms
memory: 15828kb
input:
1 300 329399 -774056 -453420 -971922 -963389 -692906 -901061 -690960 -954671 -555749 954332 -856245 97920 127454 422794 -72309 402518 -482396 -274243 -242236 -63992 224700 841180 586025 -266496 -824730 -178245 -230280 680876 907784 553835 674598 89593 396532 143208 -684880 538608 -578116 -422477 757...
output:
972.423279905521
result:
ok found '972.4232799', expected '972.4232802', error '0.0000000'
Test #35:
score: 0
Accepted
time: 427ms
memory: 15928kb
input:
1 300 -360611 262745 -266788 208188 -959303 -907228 -443316 -204307 682906 -640611 -629502 -217089 -323067 -687634 437059 491032 -924621 882842 844758 667473 765630 -661241 -192156 -841346 -154832 -812793 -47327 10282 -597348 957691 892586 942751 142330 937555 953415 -727776 -605831 643868 -310790 -...
output:
1247.635447780461
result:
ok found '1247.6354478', expected '1247.6354476', error '0.0000000'
Test #36:
score: 0
Accepted
time: 477ms
memory: 15824kb
input:
1 300 -206748 733504 405233 346961 -313290 -216319 -485737 -231831 -164104 165946 -515020 -589364 982156 -80607 873259 619605 -482416 -888108 -569548 252891 -445640 901994 985477 -967333 42455 -483916 73904 760015 -943641 942808 396828 484027 -841584 -24224 -175993 952815 790566 541282 -279849 -3442...
output:
999.019396375103
result:
ok found '999.0193964', expected '999.0193964', error '0.0000000'
Test #37:
score: 0
Accepted
time: 467ms
memory: 15688kb
input:
1 300 580502 -850604 -828356 778 184624 -535893 -697221 -969976 896503 -655248 -76966 -243055 60920 160544 44843 -658551 -447963 886466 278568 389553 -623912 -127161 678049 -413324 -430351 -318993 -817724 -933164 -711215 340590 -74113 689203 68654 -100261 182253 786353 970301 867792 -749733 -811174 ...
output:
842.059072527673
result:
ok found '842.0590725', expected '842.0590724', error '0.0000000'
Test #38:
score: 0
Accepted
time: 399ms
memory: 15664kb
input:
1 300 -316120 -118763 45309 190875 409669 -105265 -506284 573308 -516833 322648 -866719 -936225 -12677 -985703 711314 569209 941787 83443 -514860 686132 -790586 -545380 430362 -424821 -833415 938854 -942534 683223 -240135 606924 -403050 269157 -215947 985881 -549116 600378 459464 -595098 725250 1147...
output:
1024.497869412755
result:
ok found '1024.4978694', expected '1024.4978698', error '0.0000000'
Test #39:
score: 0
Accepted
time: 413ms
memory: 15796kb
input:
1 300 -173407 -202877 781435 -868900 -708456 340380 -576940 717700 182725 270819 936854 705842 -558936 563953 -442817 -537862 456021 536960 -280357 -280460 865334 142839 774139 179758 441597 150328 97859 -980348 -33644 644740 -930102 492073 -672777 225390 567301 -123428 272474 613299 939529 -568972 ...
output:
999.858900608358
result:
ok found '999.8589006', expected '999.8589008', error '0.0000000'
Test #40:
score: 0
Accepted
time: 433ms
memory: 15684kb
input:
1 300 -345250 -831776 -186776 -708481 -461210 345548 -813591 339981 875529 -243454 -612714 -565349 342248 -74704 440632 -335722 -680195 541251 -40910 -905178 644877 899186 274573 743026 873540 -442740 535392 952686 797733 860447 -20479 505758 -951532 613082 -890210 663776 767606 -285569 466835 86332...
output:
931.052311334504
result:
ok found '931.0523113', expected '931.0523112', error '0.0000000'
Test #41:
score: 0
Accepted
time: 391ms
memory: 15756kb
input:
1 300 370249 -59123 -776101 -977670 -243135 -532403 -579041 96635 569778 -862215 413939 -366298 481224 272525 393367 -40979 483831 994010 -233019 628811 -143918 477955 339126 11331 -107685 517540 622176 -412060 -177324 -205192 431089 749790 -95536 -210836 548410 -707079 616094 -127500 -783278 -72261...
output:
933.760486346322
result:
ok found '933.7604863', expected '933.7604867', error '0.0000000'
Test #42:
score: 0
Accepted
time: 368ms
memory: 15856kb
input:
1 300 572725 -213611 493742 -808213 -710052 -380510 893881 -474967 9640 -788263 -459353 580756 -26412 638961 440498 -802856 453695 -912107 22051 -399011 547574 755649 -686907 874963 -504322 -340049 692117 -724428 668948 874184 48863 726276 -663172 -738633 360506 985895 589965 723490 -791113 -581246 ...
output:
1077.841380274166
result:
ok found '1077.8413803', expected '1077.8413807', error '0.0000000'
Test #43:
score: 0
Accepted
time: 399ms
memory: 15988kb
input:
1 300 -18347 947891 -18966 947674 -18153 949129 371892 55936 -19040 948495 -19316 948666 -19369 949236 -18720 948324 -19293 949610 -17823 949522 -19243 948220 -18639 948552 -17649 949411 371651 54266 -19228 948586 -17602 948463 -19485 949188 -18243 948112 -17773 948743 372205 54093 -18298 949126 371...
output:
430.901650874245
result:
ok found '430.9016509', expected '430.9016509', error '0.0000000'
Test #44:
score: 0
Accepted
time: 351ms
memory: 15884kb
input:
1 300 -74242 456694 -526886 299650 -74220 457055 -73487 456305 -73859 456656 61507 -819056 60998 -819121 -526707 299370 -526276 300041 61552 -817655 -526738 299576 -74124 456791 -527186 299008 61978 -818405 -74813 455682 60560 -819145 -73451 455525 -74892 457185 -73693 456477 60721 -818196 60214 -81...
output:
90267.093133856630
result:
ok found '90267.0931339', expected '90267.0931341', error '0.0000000'
Test #45:
score: 0
Accepted
time: 397ms
memory: 15664kb
input:
1 300 574585 394710 574622 393610 -423278 771639 -424926 771360 -424084 771410 -355381 -781788 -355711 -782971 573941 394518 -356559 -782641 -356747 -782401 468958 -215431 -423584 771961 574237 394615 -423230 771874 574235 394702 -424141 771353 -423250 771823 469278 -214864 -423677 771854 470643 -21...
output:
217408.148135211959
result:
ok found '217408.1481352', expected '217408.1481353', error '0.0000000'
Test #46:
score: 0
Accepted
time: 424ms
memory: 15668kb
input:
1 300 426446 450150 704880 -177836 705023 -177943 365125 -787336 426646 450111 365336 -787509 -488479 191560 365230 -787626 351178 85715 426393 450079 426499 450252 350929 85788 351095 85697 350955 85774 351185 85404 426289 450343 -488469 191487 365412 -787578 351069 85754 -488205 191341 365332 -787...
output:
20170.870906608761
result:
ok found '20170.8709066', expected '20170.8709064', error '0.0000000'
Test #47:
score: 0
Accepted
time: 372ms
memory: 15908kb
input:
1 300 -400243 814451 22608 892635 -400101 814103 6514 778975 993334 -477496 6342 779132 462061 255284 -51701 297766 22472 892564 340929 -448021 479819 -339231 -400286 814390 211825 26983 6556 779317 993060 -477289 993308 -477342 -51535 297899 340706 -447842 340883 -447854 -400416 814256 -400283 8141...
output:
9230.442316656510
result:
ok found '9230.4423167', expected '9230.4423163', error '0.0000000'
Test #48:
score: 0
Accepted
time: 356ms
memory: 15816kb
input:
1 300 -474014 -864992 -630838 -307407 -630606 -307503 -124096 -743059 -771964 728691 772586 240106 -772183 728879 391413 526273 199846 912927 428389 -576556 -308290 579377 -255160 -108840 772406 240313 -367068 -161358 772571 240365 -308290 579342 391393 526479 -415239 -4737 -367131 -161451 199868 91...
output:
15025.974844090320
result:
ok found '15025.9748441', expected '15025.9748438', error '0.0000000'
Test #49:
score: 0
Accepted
time: 361ms
memory: 15932kb
input:
1 300 50620 -400031 50739 -399860 510490 905605 -231850 -472272 819819 -32769 556769 430166 510572 905474 -835681 -521539 -892931 517162 308414 643333 726593 422199 864670 -884154 -923273 383788 405709 273425 -479932 -974056 410500 738923 186655 767275 -182443 950085 -567600 -112887 603101 210566 93...
output:
3406.453545454405
result:
ok found '3406.4535455', expected '3406.4535452', error '0.0000000'
Test #50:
score: 0
Accepted
time: 472ms
memory: 15652kb
input:
1 300 176452 -329206 -579449 737212 -127383 552242 979657 -356153 80368 -694513 460265 -812959 445149 141242 -457009 -165865 607661 133016 -790741 -28932 833272 -591475 -579288 737176 -259244 232127 -387178 -302780 176289 -329051 -581332 414202 130425 339972 280492 -57804 -23731 -362222 -538093 -596...
output:
1990.340567641950
result:
ok found '1990.3405676', expected '1990.3405679', error '0.0000000'
Test #51:
score: 0
Accepted
time: 450ms
memory: 15664kb
input:
1 300 1000000 0 999780 20942 999122 41875 998026 62790 996492 83677 994521 104528 992114 125333 989272 146083 985996 166768 982287 187381 978147 207911 973578 228350 968583 248689 963162 268919 957319 289031 951056 309016 944376 328866 937281 348572 929776 368124 921863 387515 913545 406736 904827 4...
output:
499972.252536222339
result:
ok found '499972.2525362', expected '499972.2525363', error '0.0000000'
Test #52:
score: 0
Accepted
time: 511ms
memory: 15864kb
input:
1 299 1000000 0 999111 42156 996445 84238 992008 126169 985807 167877 977854 209286 968162 250323 956748 290915 943634 330989 928842 370475 912398 409303 894332 447402 874676 484707 853465 521149 830736 556665 806531 591191 780891 624666 753863 657030 725495 688227 695837 718199 664941 746895 632864...
output:
208109.814859608014
result:
ok found '208109.8148596', expected '208109.8148594', error '0.0000000'