Struct point {int X, Y; point () {} Point (int xx, int YY) {x = xx; y = YY;} point operator-(point const & B) const {return point (x-b.x, y-b.y);} int friend operator * (point a, point B) {return f_abs (. x * B. y-a.y * B. x) ;}int len2 () {return x * x + y * y ;}}; /* ===================================================== ===============* \ | rotating_calipers rotating the card shell O (N) | call: res = Graham (PNT, n); RES is the farthest point Distance Square; \ * =================================================== ============= */INT rotating_calipers (point PNT [], int N) {int q = 1, ANS = 0, I; for (I = 0; I <n; I ++) {While (PNT [(I + 1) % N]-PNT [I]) * (PNT [(q + 1) % N]-PNT [I])> (PNT [(I + 1) % N]-PNT [I]) * (PNT [Q]-PNT [I]) q = (q + 1) % N; ans = f_max (ANS, f_max (PNT [I]-PNT [Q]). len2 (), (PNT [(I + 1) % N]-PNT [(q + 1) % N]). len2 ();} return ans ;}