//嘘解法 #include #include #define rep(i, l, n) for (int i = (l); i < (n); i++) #define chmin(x, y) if(x > (y)){ x = (y); } #define chmax(x, y) if(x < (y)){ x = (y); } using namespace std; using ll = long long; template using V = vector; template using VV = V >; int N; ll max_x, max_y, min_x, min_y; bool func(VV& P, ll k) { k *= 2; VV block = { {0,0},{0,0} }; for (auto& p : P) { ll x = p[0], y = p[1]; if ((x < max_x - k and x > min_x + k) or (y < max_y - k and y > min_y + k)) { return false; } if (x < max_x - k and y < max_y - k) { block[0][0] = 1; } if (x > min_x + k and y < max_y - k) { block[1][0] = 1; } if (x < max_x - k and y > min_y + k) { block[0][1] = 1; } if (x > min_x + k and y > min_y + k) { block[1][1] = 1; } } if ((block[0][0] | block[1][1]) == 0 or (block[0][1] | block[1][0]) == 0) { return true; } return false; } int main(void) { cin >> N; VV P(N, V(2)); rep(i, 0, N) { ll x, y; cin >> x >> y; P[i] = { x + y,x - y }; } max_x = min_x = P[0][0]; max_y = min_y = P[0][1]; rep(i, 1, N) { chmax(max_x, P[i][0]); chmax(max_y, P[i][1]); chmin(min_x, P[i][0]); chmin(min_y, P[i][1]); } ll ok = 1000000001, ng = -1; while (ok - ng > 1) { ll k = (ok + ng) / 2; if (func(P, k)) { ok = k; } else { ng = k; } } ll ans = ok; cout << ans << endl; return 0; }