QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#666384 | #6133. Mirror | Crysfly | AC ✓ | 559ms | 43616kb | C++14 | 10.3kb | 2024-10-22 18:07:08 | 2024-10-22 18:07:16 |
Judging History
answer
// what is matter? never mind.
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,sse4,popcnt,abm,mmx,avx,avx2")
#include<bits/stdc++.h>
#define For(i,a,b) for(int i=(a);i<=(b);++i)
#define Rep(i,a,b) for(int i=(a);i>=(b);--i)
#define ll long long
#define ull unsigned long long
//#define int long long
#define SZ(x) ((int)((x).size()))
#define ALL(x) (x).begin(),(x).end()
using namespace std;
inline int read()
{
char c=getchar();int x=0;bool f=0;
for(;!isdigit(c);c=getchar())f^=!(c^45);
for(;isdigit(c);c=getchar())x=(x<<1)+(x<<3)+(c^48);
return f?-x:x;
}
#define fi first
#define se second
#define pb push_back
#define mkp make_pair
typedef pair<int,int>pii;
typedef vector<int>vi;
typedef long double db;
const db eps=1e-12,pi=3.14159265358979323846;
int sgn(db x){return x<-eps?-1:x>eps;}
int cmp(db a,db b){return sgn(a-b);}
struct P{
db x,y; int id;
P(db x=0,db y=0):x(x),y(y){}
P&operator +=(P o){return x+=o.x,y+=o.y,*this;}
P&operator -=(P o){return x-=o.x,y-=o.y,*this;}
P&operator *=(db o){return x*=o,y*=o,*this;}
P&operator /=(db o){return x/=o,y/=o,*this;}
friend P operator +(P a,P b){return a+=b;}
friend P operator -(P a,P b){return a-=b;}
friend P operator *(P a,db b){return a*=b;}
friend P operator /(P a,db b){return a/=b;}
friend bool operator <(P a,P b){return fabs(a.x-b.x)<eps?a.y<b.y:a.x<b.x;}
friend bool operator ==(P a,P b){return cmp(a.x,b.x)==0 && cmp(a.y,b.y)==0;}
friend bool operator !=(P a,P b){return !(a==b);}
friend db operator %(P a,P b){return a.x*b.x+a.y*b.y;} // dot
friend db operator *(P a,P b){return a.x*b.y-a.y*b.x;} // cross
P rot(db o){
db s=sin(o),c=cos(o);
return P(x*c-y*s,x*s+y*c);
}
P rot90(){return P(-y,x);}
db ang(){return atan2(y,x);}
db len(){return sqrt(x*x+y*y);}
db len2(){return x*x+y*y;}
int half(){return sgn(y)==1||(sgn(y)==0&&sgn(x)>=0);}
P unit(){return ((*this))/len();}
void read(){cin>>x>>y;}
void out(){cout<<"("<<x<<","<<y<<")"<<endl;}
};
bool cmp_dir(P a,P b){
if(a.half()!=b.half())return a.half()<b.half();
return sgn(a*b)>0;
}
db dis(P a,P b){return (a-b).len();}
db cross(P a,P b,P c){
// (a->b)*(a->c)
return (b.x-a.x)*(c.y-a.y)-(b.y-a.y)*(c.x-a.x);
}
int cmp3(P a,P b,P c){
return sgn(cross(a,b,c));
}
bool in_tri(P a,P b,P c,P p){
if(cmp3(a,b,c)<0) swap(b,c);
return cmp3(a,b,p)>=0 && cmp3(b,c,p)>=0 && cmp3(c,a,p)>=0;
}
db area_tri(P a,P b,P c){
return fabs(cross(a,b,c))/2;
}
bool paral(P p1,P p2,P q1,P q2){
// is parallel
return sgn((p2-p1)*(q2-q1))==0;
}
P interl(P p1,P p2,P q1,P q2){
// intersect point
db s1=cross(q1,q2,p1),s2=-cross(q1,q2,p2);
return (p1*s2+p2*s1)/(s1+s2);
}
bool inter(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 ismid(db a,db m,db b){
return sgn(a-m)==0||sgn(b-m)==0||((a<m)!=(b<m));
}
bool ismid(P a,P m,P b){
return ismid(a.x,m.x,b.x)&&ismid(a.y,m.y,b.y);
}
bool isseg(P p1,P p2,P q1,P q2){
return inter(p1.x,p2.x,q1.x,q2.x) && inter(p1.y,p2.y,q1.y,q2.y) &&
cmp3(p1,p2,q1)*cmp3(p1,p2,q2)<=0 && cmp3(q1,q2,p1)*cmp3(q1,q2,p2)<=0;
}
bool isseg_strict(P p1,P p2,P q1,P q2){
return cmp3(p1,p2,q1)*cmp3(p1,p2,q2)<0 && cmp3(q1,q2,p1)*cmp3(q1,q2,p2)<0;
}
struct L{
P a,b; int id;
L(P aa=P(0,0),P bb=P(0,0)){a=aa,b=bb;}
bool in(P p){return sgn((b-a)*(p-a))>0;}
int in_sgn(P p){return sgn((b-a)*(p-a));}
P dir(){return b-a;}
bool onl(P p){
return cmp3(a,b,p)==0;
}
bool onseg(P p){
return onl(p)&&ismid(a,p,b);
}
bool onseg_strict(P p){
return onl(p)&&sgn((p-a)%(a-b))*sgn((p-b)%(a-b))<0;
}
void out(){cout<<"("<<a.x<<","<<a.y<<")---("<<b.x<<","<<b.y<<")\n";}
};
bool isseg(L a,L b){
return isseg(a.a,a.b,b.a,b.b);
}
bool isseg_strict(L a,L b){
return isseg_strict(a.a,a.b,b.a,b.b);
}
bool paral(L a,L b){
// is parallel
return paral(a.a,a.b,b.a,b.b);
}
P operator &(L a,L b){
return interl(a.a,a.b,b.a,b.b);
}
bool samedir(L a,L b){
return paral(a,b) && sgn(a.dir()%b.dir())==1;
}
bool operator <(L a,L b){
if(samedir(a,b)) return b.in(a.a);
return cmp_dir(a.dir(),b.dir());
}
P proj(L a,P b){
P d=a.dir();
return a.a+d*((d%(b-a.a))/d.len2());
}
P reflect(L a,P b){
return proj(a,b)*2-b;
}
db dis(L a,P b){
db s=abs((b-a.a)*(b-a.b));
return s/dis(a.a,a.b);
}
db dis_seg(L a,P b){
if(a.a==a.b) return dis(a.a,b);
P h=proj(a,b);
if(ismid(a.a,h,a.b)) return dis(h,b);
return min(dis(a.a,b),dis(a.b,b));
}
db rad(P a,P b){
return atan2l(a*b,a%b);
}
// polygon
db area(vector<P>a){
db res=0;
For(i,0,(int)a.size()-1)res+=a[i]*a[(i+1)%a.size()];
return res/2;
}
int contain(vector<P>a,P p){
int n=a.size(),res=0;
For(i,0,n-1){
P u=a[i],v=a[(i+1)%n];
if(L(u,v).onseg(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;
res^=cmp3(p,u,v)>0;
}
return res*2;
}
vector<P>cut(vector<P>&a,P q1,P q2){
vector<P>b; int n=a.size();
For(i,0,n-1){
P p1=a[i],p2=a[(i+1)%n];
int d1=cmp3(q1,q2,p1),d2=cmp3(q1,q2,p2);
if(d1>=0)b.pb(p1);
if(d1*d2<0)b.pb(interl(p1,p2,q1,q2));
}
return b;
}
vector<P>cut(vector<P>&a,L l){
return cut(a,l.a,l.b);
}
vector<P>convex(vector<P>a){
int n=a.size(),m=0; if(n<=1)return a;
sort(a.begin(),a.end());
vector<P>st(n*2); int tp=0;
For(i,0,n-1){
while(tp>1 && cmp3(st[tp-2],st[tp-1],a[i])<=0)--tp;
st[tp++]=a[i];
}
int t=tp;
Rep(i,n-2,0){
while(tp>t && cmp3(st[tp-2],st[tp-1],a[i])<=0)--tp;
st[tp++]=a[i];
}
st.resize(tp-1);
return st;
}
db diam(vector<P>a){
int n=a.size();
if(n<=1)return 0;
int ii=0,jj=0;
For(k,1,n-1){
if(a[k]<a[ii])ii=k;
if(a[jj]<a[k])jj=k;
}
int i=ii,j=jj;
db res=dis(a[i],a[j]);
do{
if((a[(i+1)%n]-a[i])*(a[(j+1)%n]-a[j])>=0) (++j)%=n;
else (++i)%=n;
res=max(res,dis(a[i],a[j]));
}while(i!=ii||j!=jj);
return res;
}
bool check(L a,L b,L c){
return c.in(a&b);
}
int checksgn(L a,L b,L c){
return c.in_sgn(a&b);
}
vector<P>hpis(vector<L>&l,bool is=0){
if(!is)sort(l.begin(),l.end());
deque<L>q;
For(i,0,(int)l.size()-1){
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.pb(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>res;
For(i,0,(int)q.size()-1) res.pb(q[i]&q[(i+1)%q.size()]);
return res;
}
mt19937_64 rnd(64);
vector<L>cut(vector<L>&a,L l){
vector<L>b; int n=a.size();
For(i,0,n-1){
L a1=a[i],a2=a[(i+1)%n],a3=a[(i+2)%n];
int d1=checksgn(a1,a2,l),d2=checksgn(a2,a3,l);
if(d1>0 || d2>0 || (d1==0&&d2==0)) b.pb(a2);
if(d1>=0 && d2<0) b.pb(l);
}
return b;
}
#define maxn 500005
#define inf 0x3f3f3f3f
int X;
P s,t,a[5],aa[5],m1,m2,ss,tt;
L mr,l1[6],l2[6],st;
vector< tuple<int,db,int> >e[maxn];
P ps[maxn];
int tot;
void adde(int u,int v,db w,int st){
e[u].pb({v,w,st});
e[v].pb({u,w,st});
// if(st!=3)return;
// cout<<"add "<<u<<" "<<v<<"\n";
// cout<<"add: "<<w<<" "<<st<<"\n";
// ps[u].out(),ps[v].out();
}
db f[maxn];
bool vis[maxn];
db dij(int sta,int s,int t){
#define node pair<db,int>
priority_queue< node,vector<node>,greater<node> >q;
For(i,1,tot) f[i]=4e18,vis[i]=0; f[s]=0;
q.push(mkp(f[s],s));
while(q.size()){
auto [d,u]=q.top(); q.pop();
if(vis[u]) continue;
if(u==t) return f[u];
vis[u]=1;
for(auto [v,w,ww]:e[u]){
if((ww&sta)!=sta) continue;
if(f[v]>f[u]+w){
f[v]=f[u]+w;
q.push(mkp(f[v],v));
}
}
}
return 4e18;
}
db dij(int sta){
db res=dij(sta,1,2);
return res;
}
bool chk(L l){
For(i,0,2) if(isseg_strict(l,l1[i])) return 0;
if(isseg_strict(l,mr)) return 0;
return 1;
}
int add(P u){
ps[++tot]=u; e[tot].clear();
return tot;
}
void build1(){
cerr<<"build1\n";
add(s),add(t),add(m1),add(m2);
For(i,0,2)add(a[i]);
For(i,1,tot) For(j,i+1,tot) {
if(chk(L(ps[i],ps[j]))){
adde(i,j,dis(ps[i],ps[j]),0);
}
}
}
vector<L>buc;
bool see(P p,P to){
if(chk(L(p,to))) return 1;
L l=L(p,reflect(mr,to));
if(!isseg(l,mr)) return 0;
For(i,0,2)
if(isseg_strict(l,l1[i]) || isseg_strict(l,l2[i])) return 0;
return 1;
}
int is_see(L l,P to){
// cout<<"is_see: ";
// l.out(),to.out();
vector<P>vec={l.a,l.b};
for(auto ls:buc){
if(!paral(ls,l)){
P p=(ls&l);
if(ismid(l.a,p,l.b)) vec.pb(p);
}
}
sort(ALL(vec),[&](P a,P b){
return dis(a,l.a)<dis(b,l.a);
});
// for(auto ps:vec) ps.out();
For(i,1,SZ(vec)-1){
P it=(vec[i]+vec[i-1])*0.5;
if(!see(it,to)) return 0;
}
return 1;
}
void build2(){
cerr<<"build2\n";
add(s),add(t);
for(auto p1:{s,t,ss,tt}) {
for(auto p2:{m1,m2}) buc.pb(L(p1,p2));
For(i,0,2) buc.pb(L(p1,a[i]));
if(p1==ss || p1==tt) {
For(i,0,2) buc.pb(L(p1,aa[i]));
}
}
For(i,0,SZ(buc)-1){
For(j,i+1,SZ(buc)-1){
if(!paral(buc[i],buc[j])){
P p=(buc[i]&buc[j]);
if(cmp3(m1,m2,p)<0 && find(ps+1,ps+tot+1,p)==ps+tot+1) add(p);
}
}
}
sort(ps+3,ps+tot+1);
// cout<<"tot: "<<tot<<"\n";
For(i,1,tot) For(j,i+1,tot) if(chk(L(ps[i],ps[j]))) {
L l=L(ps[i],ps[j]);
int sta=(is_see(l,s))+(is_see(l,t)<<1);
adde(i,j,dis(ps[i],ps[j]),sta);
}
}
void work(int ID)
{
tot=0,buc.clear();
X=read();
s.read(),t.read(),m1.read(),m2.read();
For(i,0,2) a[i].read();
// if(ID>3){
// if(ID==20){
// cout<<X<<"\n";
// cout<<s.x<<" "<<s.y<<"\n";
// cout<<t.x<<" "<<t.y<<"\n";
// cout<<m1.x<<" "<<m1.y<<"\n";
// cout<<m2.x<<" "<<m2.y<<"\n";
// For(i,0,2)cout<<a[i].x<<" "<<a[i].y<<"\n";
// }
// return;
// }
mr=L(m1,m2);
ss=reflect(mr,s);
tt=reflect(mr,t);
For(i,0,2) aa[i]=reflect(mr,a[i]);
For(i,0,2) l1[i]=L(a[i],a[(i+1)%3]),l2[i]=L(aa[i],aa[(i+1)%3]);
db res=4e18;
if(chk(L(s,t))) res=dis(s,t)*(2*X-1);
else if(X==1){
build1();
res=dij(0);
}
else if(cmp3(m1,m2,s)<0 && cmp3(m1,m2,t)<0){
build2();
res=dij(1)+dij(3)*(X*2-3)+dij(2);
}
if(res>1e18)puts("-1");
else printf("%.12lf\n",(double)res);
}
signed main()
{
// freopen("my.out","w",stdout);
int T=read();
For(_,1,T)work(_);
return 0;
}
/*
1
2
-4 -8
3 -6
0 0
3 0
2 -7
2 -5
1 -3
*/
詳細信息
Test #1:
score: 100
Accepted
time: 34ms
memory: 40064kb
input:
2 2 -2 0 2 0 -3 3 3 3 0 1 -3 -2 3 -2 2 -2 0 2 0 -3 3 -1 3 0 1 -3 -2 3 -2
output:
13.416407864999 -1
result:
ok 2 numbers
Test #2:
score: 0
Accepted
time: 115ms
memory: 40864kb
input:
25 1 -2 0 2 0 -3 3 3 3 0 1 -3 -2 3 -2 2 -2 0 2 0 -3 3 3 3 0 1 -3 -2 3 -2 100000 -2 0 2 0 -3 3 3 3 0 1 -3 -2 3 -2 2 -2 0 2 0 -3 3 -1 3 0 1 -3 -2 3 -2 2 2 0 -2 0 3 3 -3 3 0 1 -3 -2 3 -2 1 2 0 -2 0 3 3 -3 3 0 1 -3 -2 3 -2 2 2 2 -2 2 3 3 -3 3 0 1 -3 -2 3 -2 2 0 0 4 0 0 2 4 2 1 1 3 1 2 -1 1 0 0 4 0 0 2 4...
output:
4.472135955000 13.416407864999 894422.718863960821 -1 -1 4.472135955000 12.000000000000 14.485281374239 4.472135955000 24.142135623731 6.472135955000 -1 8.261297173761 24.910407814435 41.559518455108 7.496976092671 34.702238339670 61.907500586668 7.496976092671 26.397277191929 45.108268355347 63.819...
result:
ok 25 numbers
Test #3:
score: 0
Accepted
time: 50ms
memory: 40832kb
input:
10 1 -2 0 2 0 -3 3 3 3 0 1 -3 -2 3 -2 2 -2 0 2 0 -3 3 3 3 0 1 -3 -2 3 -2 100000 -2 0 2 0 -3 3 3 3 0 1 -3 -2 3 -2 2 -2 0 2 0 -3 3 -1 3 0 1 -3 -2 3 -2 2 2 0 -2 0 3 3 -3 3 0 1 -3 -2 3 -2 1 2 0 -2 0 3 3 -3 3 0 1 -3 -2 3 -2 2 2 2 -2 2 3 3 -3 3 0 1 -3 -2 3 -2 2 0 0 4 0 0 2 4 2 1 1 3 1 2 -1 1 0 0 4 0 0 2 4...
output:
4.472135955000 13.416407864999 894422.718863960821 -1 -1 4.472135955000 12.000000000000 14.485281374239 4.472135955000 24.142135623731
result:
ok 10 numbers
Test #4:
score: 0
Accepted
time: 51ms
memory: 40396kb
input:
10 1 0 0 4 4 0 2 4 2 10 -9 20 0 10 -10 100 0 0 4 4 0 2 4 2 10 -9 20 0 10 -10 1 -2 -2 6 -4 -2 0 2 0 0 -3 3 -3 3 -6 2 -2 -2 6 -4 -2 0 2 0 0 -3 3 -3 3 -6 3 -2 -2 6 -4 -2 0 2 0 0 -3 3 -3 3 -6 1 -4 -8 3 -6 -3 0 0 0 0 -2 2 -7 -2 -7 2 -4 -8 3 -6 -3 0 0 0 0 -2 2 -7 -2 -7 3 -4 -8 3 -6 -3 0 0 0 0 -2 2 -7 -2 -...
output:
6.472135955000 -1 8.261297173761 24.910407814435 41.559518455108 7.496976092671 34.702238339670 61.907500586668 7.496976092671 26.397277191929
result:
ok 10 numbers
Test #5:
score: 0
Accepted
time: 35ms
memory: 40644kb
input:
10 3 -4 -8 3 -6 0 0 3 0 2 -7 2 -5 1 -3 4 -4 -8 3 -6 0 0 3 0 2 -7 2 -5 1 -3 555 0 -2 0 2 -2 0 2 0 10 10 10 9 9 10 555 0 -2 0 2 2 0 -2 0 10 10 10 9 9 10 1 0 -2 0 2 -2 0 2 0 10 10 10 9 9 10 30 -40 -80 30 -60 0 0 30 0 20 -70 20 -50 10 -30 40 -40 -80 30 -60 0 0 30 0 20 -70 20 -50 10 -30 5550 0 -20 0 20 -...
output:
45.108268355347 63.819259518765 -1 -1 5.656854249492 5503.050297676295 7374.149414018083 -1 -1 -1
result:
ok 10 numbers
Test #6:
score: 0
Accepted
time: 68ms
memory: 43616kb
input:
10 10 -20 0 20 0 -30 30 30 30 0 10 -30 -20 30 -20 20 -20 0 20 0 -30 30 30 30 0 10 -30 -20 30 -20 1000000 -20 0 20 0 -30 30 30 30 0 10 -30 -20 30 -20 20 -20 0 20 0 -30 30 -10 30 0 10 -30 -20 30 -20 20 20 0 -20 0 30 30 -30 30 0 10 -30 -20 30 -20 10 20 0 -20 0 30 30 -30 30 0 10 -30 -20 30 -20 20 20 20 ...
output:
849.705831449920 1744.133022449836 89442674.378632038832 -1 -1 -1 1560.000000000000 1883.086578651014 917.401153701776 2848.772003600252
result:
ok 10 numbers
Test #7:
score: 0
Accepted
time: 86ms
memory: 40896kb
input:
10 10 0 0 40 40 0 20 40 20 50 -45 100 0 50 -50 1000 0 0 40 40 0 20 40 20 50 -45 100 0 50 -50 10 -20 -20 60 -40 -20 0 20 0 0 -30 30 -30 30 -60 20 -20 -20 60 -40 -20 0 20 0 0 -30 30 -30 30 -60 30 -20 -20 60 -40 -20 0 20 0 0 -30 30 -30 30 -60 10 -40 -80 30 -60 -30 0 0 0 0 -20 20 -70 -20 -70 20 -40 -80 ...
output:
-1 -1 1581.032929398228 3245.943993465580 4910.855057532932 2523.443363156584 5243.969587856442 7964.495812556298 1760.852064992722 3631.951181334509
result:
ok 10 numbers
Test #8:
score: 0
Accepted
time: 30ms
memory: 41132kb
input:
10 2 -59 -40 -99 8 -7 -51 -61 -60 -75 -51 -51 14 -10 -1 2 46 8 26 -16 -34 34 87 5 42 -43 66 -31 71 -30 2 31 100 6 1 -94 11 -63 81 -98 -53 -81 -51 70 -69 1 72 -74 -69 -61 -55 -58 90 83 32 -62 32 -20 25 -10 88 93 75 52 4 -86 91 -77 17 61 100 -49 -74 93 61 92 -57 36 -6 -66 -13 43 3 -64 -43 -63 -56 -13 ...
output:
-1 93.722996110880 306.323358560851 141.598022585063 -1 -1 -1 17.204650534085 10356.723902856540 264.221497989849
result:
ok 10 numbers
Test #9:
score: 0
Accepted
time: 0ms
memory: 39996kb
input:
10 1 -59 -40 -99 8 -7 -51 -61 -60 -75 -51 -51 14 -10 -1 1 46 8 26 -16 -34 34 87 5 42 -43 66 -31 71 -30 1 31 100 6 1 -94 11 -63 81 -98 -53 -81 -51 70 -69 1 72 -74 -69 -61 -55 -58 90 83 32 -62 32 -20 25 -10 1 93 75 52 4 -86 91 -77 17 61 100 -49 -74 93 61 1 -61 39 97 -47 -34 2 12 -65 86 45 -18 7 67 -58...
output:
83.111071596124 31.240998703627 102.107786186951 141.598022585063 84.213958726168 192.555083133001 115.586091580062 98.005101908013 129.968825191819 145.499140890934
result:
ok 10 numbers
Test #10:
score: 0
Accepted
time: 26ms
memory: 43440kb
input:
10 2 -59 -40 -99 8 -7 -51 -61 -60 -75 -51 -51 14 -10 -1 2 46 8 26 -16 -34 34 87 5 42 -43 66 -31 71 -30 2 31 100 6 1 -94 11 -63 81 -98 -53 -81 -51 70 -69 2 72 -74 -69 -61 -55 -58 90 83 32 -62 32 -20 25 -10 2 93 75 52 4 -86 91 -77 17 61 100 -49 -74 93 61 2 -61 39 97 -47 -34 2 12 -65 86 45 -18 7 67 -58...
output:
-1 93.722996110880 306.323358560851 424.794067755189 -1 -1 -1 294.015305724039 -1 436.497422672803
result:
ok 10 numbers
Test #11:
score: 0
Accepted
time: 29ms
memory: 40360kb
input:
10 34 -59 -40 -99 8 -7 -51 -61 -60 -75 -51 -51 14 -10 -1 83 8 26 -16 -34 34 87 5 42 -43 66 -31 71 -30 9 43 -74 -69 -61 -55 -58 90 83 32 -62 32 -20 25 -10 25 92 -57 36 -6 -66 -13 43 3 -64 -43 -63 -56 -13 -21 -15 49 -12 72 88 67 -13 52 30 80 89 -46 62 41 -90 -74 42 -8 24 13 -99 71 -5 95 -11 66 98 77 9...
output:
-1 10662.626318126318 1623.922719836138 -1 -1 10356.723902856540 2554.141147235211 251.320512493509 18785.868146029345 -1
result:
ok 10 numbers
Test #12:
score: 0
Accepted
time: 8ms
memory: 40096kb
input:
10 1 50 -37 48 -61 92 72 35 -3 -35 39 7 76 -82 55 1 96 -94 75 -85 15 30 -40 29 -34 -64 35 33 61 55 2 73 59 2 -19 38 84 -39 7 -1 -35 -43 -83 92 58 2 -21 10 92 -57 34 14 -51 62 -97 27 -82 -86 -88 54 2 -61 0 -94 10 15 32 91 12 28 -94 -44 9 -96 -49 1 -90 -1 -32 -19 79 15 -7 -67 -26 -5 1 83 -89 84 87 24 ...
output:
24.083189157585 22.847319317592 316.425346645935 394.109121944672 103.445637897400 60.728905802756 -1 -1 7094.119043263934 -1
result:
ok 10 numbers
Test #13:
score: 0
Accepted
time: 23ms
memory: 39692kb
input:
10 58 87 38 79 -61 -3 11 -76 70 -88 33 4 -55 -68 -59 2 22 95 26 83 -14 26 -86 68 -63 -38 -67 0 39 43 2 6 92 -21 -16 -55 84 37 -16 -46 88 45 -18 -33 68 2 77 -51 -19 -26 31 10 51 62 27 20 -9 30 -86 -18 1 -94 16 -1 -72 -6 40 78 -89 -22 29 -38 27 -46 -47 1 1 80 -39 -32 -30 74 -76 -21 -31 -47 51 -42 -96 ...
output:
11422.111232167195 37.947331922021 -1 297.605443498603 130.680423399600 118.928549978548 23212.931962409519 180.623918681884 -1 9763.612292589254
result:
ok 10 numbers
Test #14:
score: 0
Accepted
time: 32ms
memory: 39880kb
input:
10 2 -98 -5 21 69 -12 15 23 29 26 74 49 -74 80 41 2 65 -68 69 19 -28 49 -75 27 -49 11 74 50 49 -48 2 59 -88 7 28 -8 42 42 90 25 -65 78 29 82 60 14 43 -92 51 47 -45 -51 22 95 16 16 10 -55 76 68 90 -32 3 -77 -3 97 97 -46 38 -83 -16 -66 -21 -38 -84 17 -51 91 -71 -99 -37 -10 -75 -53 12 -54 30 47 86 -43 ...
output:
420.396241657796 261.275716437636 -1 -1 8126.284575376376 -1 -1 851.630201437220 79.924964810752 -1
result:
ok 10 numbers
Test #15:
score: 0
Accepted
time: 36ms
memory: 40332kb
input:
10 2 39 71 -69 15 -24 -56 -17 -68 74 23 -65 -60 -17 73 1 -67 12 -45 -23 65 -88 -77 13 75 -68 -90 72 91 42 2 -89 -97 -48 6 14 17 -97 87 -92 -92 -23 -26 -18 -60 2 42 90 50 -34 4 43 5 -60 51 62 21 -5 33 85 2 -90 -39 46 18 35 6 -48 -61 -22 52 -33 63 -89 -42 1 -11 -39 -25 78 98 37 39 70 -54 -4 -80 -26 -5...
output:
-1 58.216253936290 -1 -1 -1 117.834629884427 6379.339307483182 -1 -1 -1
result:
ok 10 numbers
Test #16:
score: 0
Accepted
time: 15ms
memory: 40192kb
input:
10 1 -76 -65 -74 12 -22 9 95 61 -76 28 87 -78 -66 17 1 27 5 84 -27 12 95 -24 49 -36 -17 -41 89 -31 95 16 -9 84 92 -71 -43 1 -68 67 35 67 -39 -29 -62 -88 1 97 36 -23 30 94 -62 -58 -81 -62 -18 -22 11 50 -64 1 75 9 58 73 -16 58 -7 -16 17 9 14 6 73 -26 66 -77 -58 52 87 26 98 60 42 -65 -20 82 -62 -5 30 6...
output:
77.025969646607 65.368187981617 -1 120.149906367005 66.219332524573 -1 -1 -1 56.603886792340 163.559889419505
result:
ok 10 numbers
Test #17:
score: 0
Accepted
time: 29ms
memory: 43320kb
input:
10 2 -21 71 -58 45 16 40 58 -19 9 48 2 47 -58 16 10 -88 -31 -80 -73 93 -3 31 -89 0 30 -55 -95 -10 91 2 -46 -83 81 3 14 43 27 71 -24 -79 0 47 46 -71 11 -92 -30 -98 -94 89 3 19 22 -41 59 72 -46 -16 -20 72 -52 30 14 59 55 -66 -28 -14 88 -25 92 -3 -75 79 1 -46 88 51 16 81 57 -99 81 50 53 -99 37 4 -67 1 ...
output:
135.665028655140 812.347216404414 -1 1349.893329119009 -1 181.532269942410 177.248413251008 -1 -1 10522.935902114010
result:
ok 10 numbers
Test #18:
score: 0
Accepted
time: 4ms
memory: 42844kb
input:
10 1 20 82 -43 35 -14 -7 -74 -64 -57 87 51 -41 -73 60 84 -33 36 -62 -96 -33 -70 -64 -70 -7 46 87 -97 -60 -18 37 11 -1 98 -41 -73 -3 74 72 100 86 40 45 16 26 1 56 2 38 -96 54 49 -2 38 89 100 -81 -4 19 66 1 -19 -58 72 89 1 73 -65 26 -12 -66 89 92 45 -39 1 44 5 -28 95 -56 -31 60 92 90 -97 61 -86 67 -20...
output:
147.598124927925 -1 6990.107366843517 99.639349656649 172.887246493199 176.510151579491 128.413394939936 832.764672641677 141.351205473154 1467.479812467620
result:
ok 10 numbers
Test #19:
score: 0
Accepted
time: 11ms
memory: 39760kb
input:
10 2 -44 71 -77 10 60 92 24 98 -93 -55 -17 6 -10 27 2 91 -90 41 -82 45 -81 -99 -99 68 51 28 -75 -18 27 62 -54 -73 -13 61 58 90 42 100 29 37 -62 -36 -85 -19 12 25 -62 85 -12 66 92 -75 99 13 -32 -9 -68 -1 -96 1 -3 35 -48 91 85 -35 -6 -6 58 -82 -99 -24 -12 -6 2 83 62 45 81 1 -24 -53 23 -89 44 81 71 -31...
output:
208.062490612796 151.907866814066 -1 1796.357425458531 71.840100222647 -1 -1 152.322027297433 203.403539792207 386.290046467677
result:
ok 10 numbers
Test #20:
score: 0
Accepted
time: 12ms
memory: 43276kb
input:
10 1 -57 23 -54 -7 -96 -63 -77 5 77 -72 45 47 -53 82 1 17 -7 -60 -33 41 52 70 32 -7 84 -86 49 61 -15 6 11 -48 -4 -67 -87 93 77 33 -20 -65 11 -88 -31 -64 2 -1 24 1 74 -41 -23 -40 -55 -80 -14 -39 -1 -43 48 2 -83 -16 -36 71 3 18 -65 19 39 56 -15 -23 92 3 91 -15 61 0 60 -15 17 2 20 98 44 43 91 0 69 48 6...
output:
30.149626863363 81.271151093115 266.281805612024 150.119952038362 -1 2721.026644485496 12775.645776241607 -1 5139.097683445996 359.562233834423
result:
ok 10 numbers
Test #21:
score: 0
Accepted
time: 559ms
memory: 40108kb
input:
96 1 -2 0 2 0 -3 3 3 3 0 1 -3 -2 3 -2 2 -2 0 2 0 -3 3 3 3 0 1 -3 -2 3 -2 100000 -2 0 2 0 -3 3 3 3 0 1 -3 -2 3 -2 2 -2 0 2 0 -3 3 -1 3 0 1 -3 -2 3 -2 2 2 0 -2 0 3 3 -3 3 0 1 -3 -2 3 -2 1 2 0 -2 0 3 3 -3 3 0 1 -3 -2 3 -2 2 2 2 -2 2 3 3 -3 3 0 1 -3 -2 3 -2 2 0 0 4 0 0 2 4 2 1 1 3 1 2 -1 1 0 0 4 0 0 2 4...
output:
4.472135955000 13.416407864999 894422.718863960821 -1 -1 4.472135955000 12.000000000000 14.485281374239 4.472135955000 24.142135623731 6.472135955000 -1 8.261297173761 24.910407814435 41.559518455108 7.496976092671 34.702238339670 61.907500586668 7.496976092671 26.397277191929 45.108268355347 63.819...
result:
ok 96 numbers
Test #22:
score: 0
Accepted
time: 4ms
memory: 40884kb
input:
100 1 -60 -41 -100 8 -8 -52 -62 -61 -76 -52 -52 14 -11 -2 1 46 8 26 -17 -35 34 87 5 42 -44 66 -32 71 -31 1 31 100 6 1 -95 11 -64 81 -99 -54 -82 -52 70 -70 1 72 -75 -70 -62 -56 -59 90 83 32 -63 32 -21 25 -11 1 93 75 52 4 -87 91 -78 17 61 100 -50 -75 93 61 1 -62 39 97 -48 -35 2 12 -66 86 45 -19 7 67 -...
output:
84.038465524562 32.015621187164 102.107786186951 142.593828758470 84.213958726168 193.956177007693 116.405688643376 99.362970970075 130.918250804478 146.819617217864 34.058772731853 196.621463731710 133.493513364303 223.235835693512 172.386194342819 148.003378339820 95.308350455347 178.291724699712 ...
result:
ok 100 numbers
Test #23:
score: 0
Accepted
time: 83ms
memory: 43480kb
input:
100 2 -83 38 19 6 -51 -93 96 82 -60 -60 66 90 -91 -56 2 30 94 -62 92 -33 -88 -7 -89 79 54 -57 -38 -18 30 2 -53 -6 -50 17 -8 -61 -34 41 52 70 32 -8 84 -87 2 61 -16 100 32 -32 67 34 81 -78 -21 -70 68 -39 31 2 20 -47 -77 6 58 36 -85 83 41 -92 -99 -65 -30 -74 2 -65 82 -18 76 8 -100 -35 -35 47 87 -52 18 ...
output:
-1 276.065209687856 69.584481028459 185.539753152795 331.605186931688 142.144292885786 241.960740617151 413.358198176835 314.356485538314 -1 444.010135019461 147.732867026942 244.826469157238 -1 291.602469125349 411.962376922942 110.063617967065 233.634329669250 -1 138.812823615111 -1 114.0394668524...
result:
ok 100 numbers
Test #24:
score: 0
Accepted
time: 112ms
memory: 40772kb
input:
98 43 14 -89 -10 27 6 -10 -2 14 65 -42 91 35 30 87 88 -71 -27 43 -66 96 86 -80 96 -97 13 -45 36 -8 -10 68 88 -70 -97 -19 8 -13 -89 76 58 60 -11 -98 28 19 22 -95 74 -94 -59 -24 -64 85 1 72 -30 0 -79 76 -71 59 45 -21 -3 79 2 53 63 9 -47 -94 -76 23 -81 -80 22 -56 64 -18 -7 92 -29 8 4 -34 -51 89 -84 27 ...
output:
10068.823168573375 21085.139909424361 -1 5719.161651850733 -1 3462.768401149577 16647.090586646063 3843.000000000000 -1 -1 7217.246912777752 11142.334809186090 -1 2913.383771493210 13443.716487638379 -1 23245.551079722762 10964.171195307012 -1 -1 -1 -1 -1 13078.743211792178 7941.694088794909 -1 1112...
result:
ok 98 numbers
Test #25:
score: 0
Accepted
time: 127ms
memory: 40328kb
input:
100 2 -79 5 -18 49 0 3 24 -64 -78 -93 -36 -40 -95 -77 78 -68 29 -88 45 96 10 47 9 51 -6 -2 50 24 34 70 70 58 74 46 19 4 48 45 -3 11 -70 -31 15 -50 2 -46 99 6 31 41 87 -23 29 33 -47 23 -77 -38 -98 2 87 57 16 22 -60 84 -85 79 -79 -36 -88 80 -63 18 1 -86 -71 24 8 -35 43 61 -84 9 19 64 -30 2 27 1 40 -24...
output:
225.639092357685 3969.937027208366 1758.226379053619 -1 237.474209125960 194.268122227982 125.808304338479 418.325232325281 -1 32185.175624812116 -1 72.201108024739 -1 67.285874081256 510.987279685121 -1 1618.330312389903 9172.206386687993 107.296571965113 80.777472107018 83.006023877789 261.6199533...
result:
ok 100 numbers
Test #26:
score: 0
Accepted
time: 102ms
memory: 40600kb
input:
100 1 -9 32 -88 83 -18 38 77 85 -59 41 64 -52 7 -88 1 38 -50 85 83 96 -24 72 76 -51 -16 -26 55 -96 -43 1 -61 -62 93 2 -40 27 -69 -99 -56 93 -77 84 -93 20 1 1 -32 53 61 94 44 19 56 -3 -69 15 11 19 -77 1 -52 -23 35 75 -66 73 4 64 -31 -72 68 56 9 -34 1 -79 -18 6 -46 14 -48 85 -80 -75 -30 -9 -21 -80 -56...
output:
94.031909477581 145.271527868837 226.773200097994 124.187726846422 131.045793522722 99.219015696640 37.802116342872 304.644054594866 219.718001083207 -1 20788.317031448216 358.860697207147 -1 1770.136717883678 37.854986461495 386.208492915420 -1 255.704908048320 -1 170.578427709954 39.357337308309 1...
result:
ok 100 numbers