#include #define INF 4611686018427387903ll using namespace std; using ll = long long; bool func(ll n, vector > >& graph, ll mid) { vector parity(n, -1); for(int sv = 0; sv < n; ++sv){ if(parity[sv] != -1){ continue; } parity[sv] = 0; vector stk = {sv}; while(!stk.empty()){ int v = stk[stk.size() - 1]; stk.pop_back(); for(auto&[nv, nd] : graph[v]){ if(nd <= mid){ continue; } if(parity[nv] == -1){ parity[nv] = parity[v] ^ 1; stk.push_back(nv); } else if(parity[nv] == parity[v]){ return false; } } } } return true; } int main(){ int n; cin >> n; vector > p(n); for(auto&[x, y] : p){ cin >> x >> y; } vector > > graph(n, vector >({})); for(int i = 0; i < n - 1; ++i){ auto&[x1, y1] = p[i]; for(int j = i + 1; j < n; ++j){ auto&[x2, y2] = p[j]; ll d = abs(x1 - x2) + abs(y1 - y2); graph[i].push_back({j, d}); graph[j].push_back({i, d}); } } ll ok = INF, ng = -1; while(abs(ok - ng) > 1){ ll mid = (ok + ng) / 2; if(func(n, graph, mid)){ ok = mid; } else{ ng = mid; } } ll ans = ok / 2; cout << ans << endl; return 0; }