#include #include #include #define rep(i, l, n) for (int i = (l); i < (n); i++) using namespace std; using ll = long long; using Pair = pair; template using V = vector; template using VV = V >; bool func(ll N, VV&route, V&lis, ll k) { V c(N); rep(v, 0, N) { if (c[v]) { continue; } c[v] = 1; V que = { v }; while (que.empty() == false) { ll now = que[que.size() - 1]; que.pop_back(); for (auto& r : route[now]) { ll nv = r.first, nd = r.second; if (nd <= lis[k]) { continue; } if (c[nv] == 0) { c[nv] = -c[now]; que.push_back(nv); } else if (c[nv] == c[now]) { return false; } } } } return true; } int main(void) { ll N; cin >> N; VV P(N, V(2)); rep(i, 0, N) { cin >> P[i][0] >> P[i][1]; } set st = { 0 }; VV dist(N, V(N)); VV route(N, V(0)); rep(i, 0, N - 1) { rep(j, i + 1, N) { dist[i][j] = dist[j][i] = abs(P[i][0] - P[j][0]) + abs(P[i][1] - P[j][1]); route[i].push_back({ j,dist[i][j] }); route[j].push_back({ i,dist[i][j] }); st.insert(-dist[i][j]); } } V lis = {}; for (auto itr = st.begin(); itr != st.end(); itr++) { lis.push_back(-(*itr)); } ll ok = 0, ng = lis.size(); while (ng - ok > 1) { ll k = (ok + ng) / 2; if (func(N, route, lis, k)) { ok = k; } else { ng = k; } } ll ans = lis[ok] / 2; cout << ans << endl; return 0; }