#include #include #include #include #include using namespace std; const int INF = (int)1.5e9; using ll = long long; template using min_heap = priority_queue, greater>; template T dist2(T x, T y) { return x * x + y * y; } struct UnionFind { vector data; int sz; UnionFind(int sz) : data(sz, -1), sz(sz) { } bool unionSet(int x, int y) { if ((x = root(x)) == (y = root(y))) return false; if (data[x] > data[y]) swap(x, y); data[x] += data[y]; data[y] = x; sz--; return true; } bool findSet(int x, int y) { return root(x) == root(y); } int root(int x) { return data[x] < 0 ? x : data[x] = root(data[x]); } int size(int x) { return -data[root(x)]; } int size() { return sz; } }; ll cur; ll check(ll x) { return cur <= x * x; } ll binary_search(ll ok, ll ng) { assert(check(ok) == true); assert(check(ng) == false); while (abs(ng - ok) > 1) { ll mid = (ng + ok) / 2; (check(mid) ? ok : ng) = mid; } return ok; } int main() { int n; cin >> n; vector x(n), y(n); for (int i = 0; i < n; i++) cin >> x[i] >> y[i]; min_heap>> pq; for (int i = 0; i < n; i++) for (int j = i + 1; j < n; j++) { long long d = dist2(x[j] - x[i], y[j] - y[i]); pq.emplace(d, make_pair(i, j)); } UnionFind uf(n); long long ans = 1; while (true) { cur = pq.top().first; ans = (binary_search(INF, 0) + 9) / 10 * 10; int a = pq.top().second.first, b = pq.top().second.second; pq.pop(); uf.unionSet(a, b); if (uf.findSet(0, n - 1)) break; } cout << ans << endl; return 0; }