#define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ALL(v) v.begin(), v.end() typedef long long ll; #include using namespace std; static const int COUNTER_CLOCKWISE=1; static const int CLOCKWISE=-1; static const int ONLINE_BACK=2; static const int ONLINE_FRONT=-2; static const int ON_SEGMENT=0; class Point{ public: ll x,y; Point(ll x=0, ll y=0): x(x),y(y) {} Point operator+(Point p){return Point(x+p.x,y+p.y);} Point operator-(Point p){return Point(x-p.x,y-p.y);} Point operator*(ll a){return Point(a*x,a*y);} Point operator/(ll a){return Point(x/a,y/a);} bool operator<(const Point &p) const{ return x != p.x ? x Polygon; ll dot(Vector a,Vector b){return a.x*b.x+a.y*b.y;} ll cross(Vector a,Vector b){return a.x*b.y-a.y*b.x;} int ccw(Point p0,Point p1,Point p2){ Vector a=p1-p0; Vector b=p2-p0; if(cross(a,b)>0) return COUNTER_CLOCKWISE; if(cross(a,b)<0) return CLOCKWISE; return ON_SEGMENT; } Polygon andrewScan(Polygon s){ Polygon u,l; if(s.size()<3) return s; sort(ALL(s)); u.push_back(s[0]); u.push_back(s[1]); l.push_back(s[s.size()-1]); l.push_back(s[s.size()-2]); for(int i=2;i<(int)s.size();i++){ for(int j=(int)u.size();j>=2 && ccw(u[j-2],u[j-1],s[i])==COUNTER_CLOCKWISE;j--){ u.pop_back(); } u.push_back(s[i]); } for(int i=(int)s.size()-3;i>=0;i--){ for(int j=(int)l.size();j>=2 && ccw(l[j-2],l[j-1],s[i])==COUNTER_CLOCKWISE;j--){ l.pop_back(); } l.push_back(s[i]); } reverse(ALL(l)); for(int i=(int)u.size()-2;i>=1;i--) l.push_back(u[i]); return l; } //最遠点対間距離(キャリパー法) bool cmp_x(const Point& p,const Point& q){ if(p.x!=q.x) return p.x>n; Polygon p,q; rep(i,n){ ll x,y; cin>>x>>y; p.push_back(Point(x,y)); } Polygon tmp1=andrewScan(p); ll ans1=calipers(tmp1); rep(i,n){ ll x,y; cin>>x>>y; q.push_back(Point(x,y)); } Polygon tmp2=andrewScan(q); ll ans2=calipers(tmp2); cout<