func_code_string: #include <bits/stdc++.h>   inline int pidorand() { return ((rand() & 32767) << 15) | (rand() & 32767); }   using namespace std;   inline int nxt() {     int x;     scanf( %d , &x);     return x;   }   using Point = pair<int, int>;   int mydiv(int first, int second) {     if (first % second == 0) {       return first / second;     } else {       return first / second - (first < 0);     }   }   Point convert(int first, int second) {     first += second;     second = first - 2 * second;     return {mydiv(first, 2), mydiv(second, 2)};   }   const int N = 111111;   int up_y[N + N], down_y[N + N];   int left_y[N + N], right_y[N + N];   int main() {     int n = nxt();     vector<Point> ppts[2];     for (int i = 0; i < n; ++i) {       int first = nxt(), second = nxt();       ppts[(abs(first) + abs(second)) % 2].push_back(convert(first, second));     }     for (int i = 0; i < 2; ++i) {       sort((ppts[i]).begin(), (ppts[i]).end());     }     long long ans = 0;     for (auto pts : ppts) {       for (int i = 0; i < N + N; ++i) {         left_y[i] = right_y[i] = -N;       }       for (auto pt : pts) {         left_y[pt.first + N] = max(left_y[pt.first + N], pt.second);         right_y[pt.first + N] = max(right_y[pt.first + N], pt.second);       }       for (int i = 1; i < N + N; ++i) {         left_y[i] = max(left_y[i], left_y[i - 1]);       }       for (int i = N + N - 2; i >= 0; --i) {         right_y[i] = max(right_y[i], right_y[i + 1]);       }       for (int i = 0; i < N + N; ++i) {         up_y[i] = min(left_y[i], right_y[i]);       }       for (int i = 0; i < N + N; ++i) {         left_y[i] = right_y[i] = N;       }       for (auto pt : pts) {         left_y[pt.first + N] = min(left_y[pt.first + N], pt.second);         right_y[pt.first + N] = min(right_y[pt.first + N], pt.second);       }       for (int i = 1; i < N + N; ++i) {         left_y[i] = min(left_y[i], left_y[i - 1]);       }       for (int i = N + N - 2; i >= 0; --i) {         right_y[i] = min(right_y[i], right_y[i + 1]);       }       for (int i = 0; i < N + N; ++i) {         down_y[i] = max(left_y[i], right_y[i]);       }       for (int i = 1; i < N + N; ++i) {         int l = max(down_y[i - 1], down_y[i]);         int r = min(up_y[i - 1], up_y[i]);         if (l >= r) {           continue;         }         ans += r - l;       }     }     cout << ans <<   n ;     return 0;   }   