#include using namespace std; using ll=long long; using ull=unsigned long long; using P=pair; templateusing minque=priority_queue,greater>; templatebool chmax(T &a,const T &b){return (abool chmin(T &a,const T &b){return (a>b?(a=b,true):false);} templateistream &operator>>(istream &is,pair&p){is>>p.first>>p.second;return is;} templateistream &operator>>(istream &is,tuple&a){is>>std::get<0>(a)>>std::get<1>(a)>>std::get<2>(a);return is;} templateistream &operator>>(istream &is,array&a){for(auto&i:a)is>>i;return is;} templateistream &operator>>(istream &is,vector &a){for(auto &i:a)is>>i;return is;} templatevoid operator++(pair&a,int n){a.first++,a.second++;} templatevoid operator--(pair&a,int n){a.first--,a.second--;} templatevoid operator++(vector&a,int n){for(auto &i:a)i++;} templatevoid operator--(vector&a,int n){for(auto &i:a)i--;} #define overload3(_1,_2,_3,name,...) name #define rep1(i,n) for(int i=0;i<(int)(n);i++) #define rep2(i,l,r) for(int i=(int)(l);i<(int)(r);i++) #define rep(...) overload3(__VA_ARGS__,rep2,rep1)(__VA_ARGS__) #define reps(i,l,r) rep2(i,l,r) #define all(x) x.begin(),x.end() #define pcnt(x) __builtin_popcountll(x) #define fin(x) return cout<<(x)<<'\n',static_cast(0) #define yn(x) cout<<((x)?"Yes\n":"No\n") #define uniq(x) sort(all(x)),x.erase(unique(all(x)),x.end()) template inline int fkey(vector&z,T key){return lower_bound(z.begin(),z.end(),key)-z.begin();} ll myceil(ll a,ll b){return (a+b-1)/b;} template auto vec(const int (&d)[n],const T &init=T()){ if constexpr (id(d,init)); else return init; } #ifdef LOCAL #include #define SWITCH(a,b) (a) #else #define debug(...) static_cast(0) #define debugg(...) static_cast(0) #define SWITCH(a,b) (b) templateostream &operator<<(ostream &os,const pair&p){os<>testcase; for(int i=0;i #include templateconstexpr std::enable_if_t,T> epsilon(){return 1e-10;} templateconstexpr std::enable_if_t,T>epsilon(){return 0;} template struct Point{ static_assert(std::is_arithmetic_v); static constexpr T eps=epsilon(); T x,y; constexpr Point():x(0),y(0){} constexpr Point(T x_,T y_):x(x_),y(y_){} Point &operator+=(const Point&rhs){ this->x+=rhs.x; this->y+=rhs.y; return *this; } Point &operator-=(const Point&rhs){ this->x-=rhs.x; this->y-=rhs.y; return *this; } Point &operator*=(const T&rhs){ this->x*=rhs; this->y*=rhs; return *this; } Point &operator/=(const T&rhs){ this->x/=rhs; this->y/=rhs; return *this; } friend Point operator+(const Point&lhs,const Point&rhs){return Point(lhs)+=rhs;} friend Point operator-(const Point&lhs,const Point&rhs){return Point(lhs)-=rhs;} friend Point operator*(const Point&lhs,const T&rhs){return Point(lhs)*=rhs;} friend Point operator/(const Point&lhs,const T&rhs){return Point(lhs)/=rhs;} friend bool operator==(const Point&lhs,const Point&rhs){return std::abs(lhs.x-rhs.x)<=eps&&std::abs(lhs.y-rhs.y)<=eps;} friend bool operator!=(const Point&lhs,const Point&rhs){return !(lhs==rhs);} friend std::istream &operator>>(std::istream&is,Point&p){ is>>p.x>>p.y; return is; } friend std::ostream &operator<<(std::ostream&os,const Point&p){ os<); return atan2l(y,x); } Pointrot(T theta)const{ static_assert(std::is_floating_point_v); T s=sin(theta),c=cos(theta); return Point(c*x-s*y,s*x+c*y); } Pointrot90(){ return Point(-y,x); } T norm()const{return x*x+y*y;} template Pointconvert()const{ Pointres(this->x,this->y); return res; } }; template T cross(const Point&a,const Point&b){return a.x*b.y-a.y*b.x;} template T dot(const Point&a,const Point&b){return a.x*b.x+a.y*b.y;} //交差する点のうち1つ template std::conditional_t,std::optional>,bool>intersect(const Point&a,const Point&b,const Point&c,const Point&d){ T ac=cross(d-c,a-c),bc=cross(d-c,b-c),cc=cross(b-a,c-a),dc=cross(b-a,d-a); T ab=(b-a).norm(),cd=(d-c).norm(); if(std::abs(ac)<=epsilon()){ if((c-a).norm()<=cd+epsilon()&&(d-a).norm()<=cd+epsilon()){ if constexpr(std::is_floating_point_v)return std::make_optional(a); else return true; } else if(std::abs(bc)<=epsilon()){ if((c-b).norm()<=cd+epsilon()&&(d-b).norm()<=cd+epsilon()){ if constexpr(std::is_floating_point_v)return std::make_optional(b); else return true; } } if(dot(a-c,b-c)()){ if constexpr(std::is_floating_point_v)return std::make_optional(c); else return true; } if constexpr(std::is_floating_point_v)return std::nullopt; else return false; } if(std::abs(bc)<=epsilon()){ if((c-b).norm()<=cd+epsilon()&&(d-b).norm()<=cd+epsilon()){ if constexpr(std::is_floating_point_v)return std::make_optional(b); else return true; } if constexpr(std::is_floating_point_v)return std::nullopt; else return false; } if(std::abs(cc)<=epsilon()){ if((a-c).norm()<=ab+epsilon()&&(b-c).norm()<=ab+epsilon()){ if constexpr(std::is_floating_point_v)return std::make_optional(c); else return true; } if constexpr(std::is_floating_point_v)return std::nullopt; else return false; } if(std::abs(dc)<=epsilon()){ if((a-d).norm()<=ab+epsilon()&&(b-d).norm()<=ab+epsilon()){ if constexpr(std::is_floating_point_v)return std::make_optional(d); else return true; } if constexpr(std::is_floating_point_v)return std::nullopt; else return false; } if((ac>0)!=(bc>0)&&(cc>0)!=(dc>0)){ if constexpr(std::is_floating_point_v)return c+(d-c)*cross(b-a,b-c)/cross(b-a,d-c); else return true; } else{ if constexpr(std::is_floating_point_v)return std::nullopt; else return false; } } template struct ConvexHullTrickDeque{ static constexpr T inf=std::numeric_limits::max(); static constexpr T eps=epsilon(); static inline bool is_concave(const Point&l,const Point&m,const Point&r){ if constexpr(LOWERHULL)return cross(m-l,r-l)>eps; else return cross(m-l,r-l)>que; static constexpr Pointnone{inf,inf}; ConvexHullTrickDeque():que(){} Pointadd_left(const Point&v){ if(que.empty()){ que.push_front(v); return none; } while(que.size()>=2){ const Point&m=que[0]; const Point&r=que[1]; if(is_concave(v,m,r))break; que.pop_front(); } Pointres=que.front(); que.push_front(v); return res; } Pointadd_right(const Point&v){ if(que.empty()){ que.push_back(v); return none; } while(que.size()>=2){ const Point&l=que[que.size()-2]; const Point&m=que.back(); if(is_concave(l,m,v))break; que.pop_back(); } Pointres=que.back(); que.push_back(v); return res; } }; template std::vector>static_convex_hull(std::vector>points){ std::sort(points.begin(),points.end(),[](const Point&lhs,const Point&rhs){return lhs.x==rhs.x?lhs.ylower; ConvexHullTrickDequeupper; for(const Point&p:points)lower.add_right(p),upper.add_right(p); std::vector>res(lower.que.begin(),lower.que.end()); res.insert(res.end(),upper.que.rbegin()+1,upper.que.rend()-1); return res; } bool operator<(Pointa,Pointb){ if(a.x!=b.x)return a.x>n; vector>a(n); cin>>a; auto hull=static_convex_hull(a); int m=hull.size(); vector,Point>>ans(m); if(m==2){ ans[0]={hull[0],hull[0]-hull[1]}; ans[1]={hull[1],hull[1]-hull[0]}; } else{ rep(i,m){ Pointpre=i?hull[i-1]:hull[m-1]; Pointnxt=i+1d1=(pre-hull[i]).rot90(); Pointd2=(hull[i]-nxt).rot90(); ans[i]={hull[i],d1+d2}; } } sort(all(ans)); rep(i,n){ auto itr=lower_bound(all(ans),make_pair(a[i],Point{-inf,-inf})); if(itr!=ans.end()&&itr->first==a[i])cout<second<<'\n'; else cout<<"No\n"; } }