#include namespace { #pragma GCC diagnostic ignored "-Wunused-function" #include #pragma GCC diagnostic warning "-Wunused-function" using namespace std; using namespace atcoder; #define rep(i,n) for(int i = 0; i < (int)(n); i++) #define rrep(i,n) for(int i = (int)(n) - 1; i >= 0; i--) #define all(x) begin(x), end(x) #define rall(x) rbegin(x), rend(x) template bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } else return false; } template bool chmin(T& a, const T& b) { if (b < a) { a = b; return true; } else return false; } using ll = long long; using P = pair; using VI = vector; using VVI = vector; using VL = vector; using VVL = vector; struct S { ll xl, xr, yl, yr; static S sq(P p, ll d) { auto [x, y] = p; return S{x-d, x+d, y-d, y+d}; }; friend S merge(S a, S b) { return S{max(a.xl, b.xl), min(a.xr, b.xr), max(a.yl, b.yl), min(a.yr, b.yr)}; } friend bool intersect(S a, S b) { return a.xl <= b.xr && a.xr >= b.xl && a.yl <= b.yr && a.yr >= b.yl; } bool empty() { return !(xl <= xr && yl <= yr); }; }; } int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector

xy(n); for (auto& [x, y] : xy) { cin >> x >> y; x *= 2, y *= 2; tie(x, y) = pair(x - y, x + y); } ll ans = 8e9; rep(_, 2) { ll l = -1, r = 8e9; sort(all(xy)); while (r - l > 1) { ll c = midpoint(l, r); S s1 = S::sq(xy[0], c), s2 = S::sq(xy[n-1], c); static vector todo; todo.clear(); for (auto p : xy) { auto s = S::sq(p, c); if (!intersect(s1, s)) s2 = merge(s, s2); else if (!intersect(s2, s)) s1 = merge(s, s1); else todo.emplace_back(s); } rrep(i, ssize(todo)) { auto s = todo[i]; if (intersect(s1, s) && intersect(s2, s)) continue; if (!intersect(s1, s)) s2 = merge(s, s2); else if (!intersect(s2, s)) s1 = merge(s, s1); swap(todo.back(), todo[i]); todo.pop_back(); } ranges::sort(todo, {}, &S::yl); bool ok = false; rep(i, ssize(todo) + 1) { S t1 = s1, t2 = s2; if (i) t1 = merge(merge(t1, todo[0]), todo[i-1]); if (i < ssize(todo)) t2 = merge(merge(t2, todo[i]), todo.back()); if (!t1.empty() && !t2.empty()) { ok = true; break; } } (ok ? r : l) = c; } chmin(ans, r); for (auto& [x, y] : xy) swap(x, y); } cout << ans << '\n'; }