#include <bits/stdc++.h>
using namespace std;
using _T=double; //long long
constexpr _T eps=1e-8;
constexpr long double PI=3.1415926535897932384l;
template<typename T> struct point
{
T x,y;
bool operator==(const point &a) const {return (abs(x-a.x)<=eps && abs(y-a.y)<=eps);}
bool operator<(const point &a) const {if (abs(x-a.x)<=eps) return y<a.y-eps; return x<a.x-eps;}
bool operator>(const point &a) const {return !(*this<a || *this==a);}
point operator+(const point &a) const {return {x+a.x,y+a.y};}
point operator-(const point &a) const {return {x-a.x,y-a.y};}
point operator-() const {return {-x,-y};}
point operator*(const T k) const {return {k*x,k*y};}
point operator/(const T k) const {return {x/k,y/k};}
T operator*(const point &a) const {return x*a.x+y*a.y;}
T operator^(const point &a) const {return x*a.y-y*a.x;}
int toleft(const point &a) const {const auto t=(*this)^a; return (t>eps)-(t<-eps);}
T len2() const {return (*this)*(*this);}
T dis2(const point &a) const {return (a-(*this)).len2();}
double len() const {return sqrt(len2());}
double dis(const point &a) const {return sqrt(dis2(a));}
double ang(const point &a) const {return acos(max(-1.0,min(1.0,((*this)*a)/(len()*a.len()))));}
point rot(const double rad) const {return {x*cos(rad)-y*sin(rad),x*sin(rad)+y*cos(rad)};}
point rot(const double cosr,const double sinr) const {return {x*cosr-y*sinr,x*sinr+y*cosr};}
};
using Point=point<_T>;
struct argcmp
{
bool operator()(const Point &a,const Point &b) const
{
const auto quad=[](const Point &a)
{
if (a.y<-eps) return 1;
if (a.y>eps) return 4;
if (a.x<-eps) return 5;
if (a.x>eps) return 3;
return 2;
};
const int qa=quad(a),qb=quad(b);
if (qa!=qb) return qa<qb;
const auto t=a^b;
//if (abs(t)<=eps) return a*a<b*b-eps;
return t>eps;
}
};
template<typename T> struct line
{
point<T> p,v;
bool operator==(const line &a) const {return v.toleft(a.v)==0 && v.toleft(p-a.p)==0;}
int toleft(const point<T> &a) const {return v.toleft(a-p);}
point<T> inter(const line &a) const {return p+v*((a.v^(p-a.p))/(v^a.v));}
double dis(const point<T> &a) const {return abs(v^(a-p))/v.len();}
point<T> proj(const point<T> &a) const {return p+v*((v*(a-p))/(v*v));}
bool operator<(const line &a) const
{
if (abs(v^a.v)<=eps && v*a.v>=-eps) return toleft(a.p)==-1;
return argcmp()(v,a.v);
}
};
using Line=line<_T>;
template<typename T> struct segment
{
point<T> a,b;
int is_on(const point<T> &p) const
{
if (p==a || p==b) return -1;
return (p-a).toleft(p-b)==0 && (p-a)*(p-b)<-eps;
}
int is_inter(const line<T> &l) const
{
if (l.toleft(a)==0 || l.toleft(b)==0) return -1;
return l.toleft(a)!=l.toleft(b);
}
int is_inter(const segment<T> &s) const
{
if (is_on(s.a) || is_on(s.b) || s.is_on(a) || s.is_on(b)) return -1;
const line<T> l{a,b-a},ls{s.a,s.b-s.a};
return l.toleft(s.a)*l.toleft(s.b)==-1 && ls.toleft(a)*ls.toleft(b)==-1;
}
double dis(const point<T> &p) const
{
if ((p-a)*(b-a)<-eps || (p-b)*(a-b)<-eps) return min(p.dis(a),p.dis(b));
const line<T> l{a,b-a};
return l.dis(p);
}
double dis(const segment<T> &s) const
{
if (is_inter(s)) return 0;
return min({dis(s.a),dis(s.b),s.dis(a),s.dis(b)});
}
};
using Segment=segment<_T>;
template<typename T> struct polygon
{
vector<point<T>> p;
size_t nxt(const size_t i) const {return i==p.size()-1?0:i+1;}
size_t pre(const size_t i) const {return i==0?p.size()-1:i-1;}
pair<bool,int> winding(const point<T> &a) const
{
int cnt=0;
for (size_t i=0;i<p.size();i++)
{
point<T> u=p[i],***xt(i)];
if (abs((a-u)^(a-v))<=eps && (a-u)*(a-v)<=eps) return {true,0};
if (abs(u.y-v.y)<=eps) continue;
const Line uv={u,v-u};
if (u.y<v.y-eps && uv.toleft(a)<=0) continue;
if (u.y>v.y+eps && uv.toleft(a)>=0) continue;
if (u.y<a.y-eps && v.y>=a.y-eps) cnt++;
if (u.y>=a.y-eps && v.y<a.y-eps) cnt--;
}
return {false,cnt};
}
double circ() const
{
double sum=0;
for (size_t i=0;i<p.size();i++) sum+=p[i].dis(p[nxt(i)]);
return sum;
}
T area() const
{
T sum=0;
for (size_t i=0;i<p.size();i++) sum+=p[i]^p[nxt(i)];
return sum;
}
};
using Polygon=polygon<_T>;
template<typename T> struct convex: polygon<T>
{
convex operator+(const convex &c) const
{
const auto &p=this->p;
vector<Segment> e1(p.size()),e2(c.p.size()),edge(p.size()+c.p.size());
vector<point<T>> res; res.reserve(p.size()+c.p.size());
const auto cmp=[](const Segment &u,const Segment &v) {return argcmp()(u.b-u.a,v.b-v.a);};
for (size_t i=0;i<p.size();i++) e1[i]={p[i],p[this->nxt(i)]};
for (size_t i=0;i<c.p.size();i++) e2[i]={c.p[i],c.p[c.nxt(i)]};
rotate(e1.begin(),min_element(e1.begin(),e1.end(),cmp),e1.end());
rotate(e2.begin(),min_element(e2.begin(),e2.end(),cmp),e2.end());
merge(e1.begin(),e1.end(),e2.begin(),e2.end(),edge.begin(),cmp);
const auto check=[](const vector<point<T>> &res,const point<T> &u)
{
const auto back1=res.back(),back2=*prev(res.end(),2);
return (back1-back2).toleft(u-back1)==0 && (back1-back2)*(u-back1)>=-eps;
};
auto u=e1[0].a+e2[0].a;
for (const auto &v:edge)
{
while (res.size()>1 && check(res,u)) res.pop_back();
res.push_back(u);
u=u+v.b-v.a;
}
if (res.size()>1 && check(res,res[0])) res.pop_back();
return {res};
}
template<typename F> void rotcaliper(const F &func) const
{
const auto &p=this->p;
const auto area=[](const point<T> &u,const point<T> &v,const point<T> &w){return abs((w-u)^(w-v));};
for (size_t i=0,j=1;i<p.size();i++)
{
const auto nxti=this->nxt(i);
func(p[i],p[nxti],p[j]);
while (area(p[this->nxt(j)],p[i],p[nxti])>=area(p[j],p[i],p[nxti]))
{
j=this->nxt(j);
func(p[i],p[nxti],p[j]);
}
}
}
T diameter2() const
{
const auto &p=this->p;
if (p.size()==1) return 0;
if (p.size()==2) return p[0].dis2(p[1]);
T ans=0;
auto func=[&](const point<T> &u,const point<T> &v,const point<T> &w){ans=max({ans,w.dis2(u),w.dis2(v)});};
rotcaliper(func);
return ans;
}
vector<T> sum;
void get_sum()
{
const auto &p=this->p;
vector<T> a(p.size());
for (size_t i=0;i<p.size();i++) a[i]=p[this->pre(i)]^p[i];
sum.resize(p.size());
partial_sum(a.begin(),a.end(),sum.begin());
}
T query_sum(const size_t l,const size_t r) const
{
const auto &p=this->p;
if (l<=r) return sum[r]-sum[l]+(p[r]^p[l]);
return sum[p.size()-1]-sum[l]+sum[r]+(p[r]^p[l]);
}
T query_sum() const {return sum.back();}
int is_in(const point<T> &a) const
{
const auto &p=this->p;
if (p.size()==1) return a==p[0]?-1:0;
if (p.size()==2) return segment<T>{p[0],p[1]}.is_on(a)?-1:0;
if (a==p[0]) return -1;
if ((p[1]-p[0]).toleft(a-p[0])==-1 || (p.back()-p[0]).toleft(a-p[0])==1) return 0;
const auto cmp=[&](const Point &u,const Point &v){return (u-p[0]).toleft(v-p[0])==1;};
const size_t i=lower_bound(p.begin()+1,p.end(),a,cmp)-p.begin();
if (i==1) return segment<T>{p[0],p[i]}.is_on(a)?-1:0;
if (i==p.size()-1 && segment<T>{p[0],p[i]}.is_on(a)) return -1;
if (segment<T>{p[i-1],p[i]}.is_on(a)) return -1;
return (p[i]-p[i-1]).toleft(a-p[i-1])>0;
}
template<typename F> size_t extreme(const F &dir) const
{
const auto &p=this->p;
const auto check=[&](const size_t i){return dir(p[i]).toleft(p[this->nxt(i)]-p[i])>=0;};
const auto dir0=dir(p[0]); const auto check0=check(0);
if (!check0 && check(p.size()-1)) return 0;
const auto cmp=[&](const Point &v)
{
const size_t vi=&v-p.data();
const auto checkv=check(vi);
const auto t=dir0.toleft(v-p[0]);
return checkv^(checkv==check0 && ((!check0 && t<=0) || (check0 && t<0)));
};
return partition_point(p.begin(),p.end(),cmp)-p.begin();
}
pair<size_t,size_t> tangent(const point<T> &a) const //!is_in(a)
{
const size_t i=extreme([&](const point<T> &u){return u-a;});
const size_t j=extreme([&](const point<T> &u){return a-u;});
return {i,j};
}
pair<size_t,size_t> tangent(const line<T> &a) const
{
const size_t i=extreme([&](...){return a.v;});
const size_t j=extreme([&](...){return -a.v;});
return {i,j};
}
};
using Convex=convex<_T>;
Convex convexhull(vector<Point> p)
{
vector<Point> st;
sort(p.begin(),p.end());
const auto check=[](const vector<Point> &st,const Point &u)
{
const auto back1=st.back(),back2=*prev(st.end(),2);
return (back1-back2).toleft(u-back2)<=0;
};
for (const Point &u:p)
{
while (st.size()>1 && check(st,u)) st.pop_back();
st.push_back(u);
}
size_t k=st.size();
p.pop_back(); reverse(p.begin(),p.end());
for (const Point &u:p)
{
while (st.size()>k && check(st,u)) st.pop_back();
st.push_back(u);
}
st.pop_back();
return {st};
}
pair<_T,_T> minmax_triangle(const vector<Point> &vec)
{
if (vec.size()<=2) return {0,0};
vector<pair<int,int>> evt;
evt.reserve(vec.size()*vec.size());
_T maxans=0,minans=numeric_limits<_T>::max();
for (size_t i=0;i<vec.size();i++)
{
for (size_t j=0;j<vec.size();j++)
{
if (i==j) continue;
if (vec[i]==vec[j]) minans=0;
else evt.push_back({i,j});
}
}
sort(evt.begin(),evt.end(),[&](const pair<int,int> &u,const pair<int,int> &v)
{
const Point du=vec[u.second]-vec[u.first],dv=vec[v.second]-vec[v.first];
return argcmp()({du.y,-du.x},{dv.y,-dv.x});
});
vector<size_t> vx(vec.size()),pos(vec.size());
for (size_t i=0;i<vec.size();i++) vx[i]=i;
sort(vx.begin(),vx.end(),[&](int x,int y){return vec[x]<vec[y];});
for (size_t i=0;i<vx.size();i++) pos[vx[i]]=i;
for (auto [u,v]:evt)
{
const size_t i=pos[u],j=pos[v];
const size_t _i=min(i,j),_j=max(i,j);
const Point vecu=vec[u],vecv=vec[v];
if (_i>0) minans=min(minans,abs((vec[vx[_i-1]]-vecu)^(vec[vx[_i-1]]-vecv)));
if (_j<vx.size()-1) minans=min(minans,abs((vec[vx[_j+1]]-vecu)^(vec[vx[_j+1]]-vecv)));
maxans=max({maxans,abs((vec[vx[0]]-vecu)^(vec[vx[0]]-vecv)),abs((vec[vx.back()]-vecu)^(vec[vx.back()]-vecv))});
if (i<j) swap(vx[i],vx[j]),pos[u]=j,pos[v]=i;
}
return {minans,maxans};
}