func_code_string: #include <bits/stdc++.h>   using namespace std;   int dr[4][2] = {{1, 1}, {-1, 1}, {-1, -1}, {1, -1}};   bool eq(double d1, double d2) { return fabs(d1 - d2) < 1e-7; }   int getState(double dx, double dy) {     for (int i = 0; i < 4; i++)       if (!eq(dx, 0) && !eq(dy, 0))         if (dx * dr[i][0] > 0 && dy * dr[i][1] > 0) return i;     if (eq(dx, 0)) {       if (dy > 0)         return 1;       else         return 3;     }     if (eq(dy, 0)) {       if (dx > 0)         return 0;       else         return 2;     }     return 10000;   }   namespace std {   bool operator<(const complex<double>& a, const complex<double>& b) {     return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);   }   }  // namespace std   double cross(const complex<double>& a, const complex<double>& b) {     return imag(conj(a) * b);   }   double dot(const complex<double>& a, const complex<double>& b) {     return real(conj(a) * b);   }   int ccw(complex<double> a, complex<double> b, complex<double> c) {     b -= a;     c -= a;     if (cross(b, c) > 0) return +1;     if (cross(b, c) < 0) return -1;     if (dot(b, c) < 0) return +2;     if (norm(b) < norm(c)) return -2;     return 0;   }   bool isconvex(const vector<complex<double> >& P) {     for (int i = 0; i < P.size(); ++i) {       if (ccw(P[(i + P.size() - 1) % P.size()], P[(i) % P.size()],               P[(i + 1) % P.size()]) > 0)         return false;     }     return true;   }   vector<complex<double> > convex_hull(vector<complex<double> >& ps) {     int n = ps.size(), k = 0;     sort(ps.begin(), ps.end());     vector<complex<double> > ch(2 * n);     for (int i = 0; i < n; ch[k++] = ps[i++])       while (k >= 2 && ccw(ch[k - 2], ch[k - 1], ps[i]) <= 0) --k;     for (int i = n - 2, t = k + 1; i >= 0; ch[k++] = ps[i--])       while (k >= t && ccw(ch[k - 2], ch[k - 1], ps[i]) <= 0) --k;     ch.resize(k - 1);     return ch;   }   vector<complex<double> > poly, temp;   vector<complex<double> > cn;   int n, ptr = 0;   bool eqq(complex<double> p1, complex<double> p2) {     return eq(p1.imag(), p2.imag()) && eq(p1.real(), p2.real());   }   int main() {     cin >> n;     poly.resize(n);     for (int i = 0; i < n; i++) {       int x, y;       scanf( %d%d , &x, &y);       poly[i] = complex<double>(x, y);     }     sort(poly.begin(), poly.end());     for (int i = 0; i < poly.size(); i++)       if (i == 0 || poly[i] != poly[i - 1]) temp.push_back(poly[i]);     poly = temp;     n = poly.size();     if (n == 1)       cout << 4 << endl;     else {       cn = convex_hull(poly);       n = cn.size();       int res = 0, curS = getState(cn[1].real() - cn[0].real(),                                    cn[1].imag() - cn[0].imag());       int fs = curS;       for (int i = 0; i < cn.size(); i++) {         int j = (i + 1) % cn.size();         int dx = (int)(cn[j].real() - cn[i].real());         int dy = (int)(cn[j].imag() - cn[i].imag());         int state = getState(dx, dy);         res += max(abs(dx), abs(dy));         while (curS != state) res++, curS = (curS + 1) % 4;       }       while (curS != fs) res++, curS = (curS + 1) % 4;       cout << res << endl;     }     return 0;   }   