#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair i_i; typedef pair ll_i; typedef pair d_i; typedef pair ll_ll; typedef pair d_d; struct edge { int u, v; ll w; }; ll MOD = 1000000007; ll _MOD = 1000000009; double EPS = 1e-10; struct union_find { vector v; union_find(int n) : v(n, -1) {} int find(int x) { return (v[x] < 0) ? x : (v[x] = find(v[x])); } void unite(int x, int y) { x = find(x); y = find(y); if (x != y) { if (-v[x] < -v[y]) swap(x, y); v[x] += v[y]; v[y] = x; } } bool same(int x, int y) { return find(x) == find(y); } int size(int x) { return -v[find(x)]; } }; int main() { int N; cin >> N; vector X(N), Y(N); for (int i = 0; i < N; i++) cin >> X[i] >> Y[i]; vector > a; for (int i = 0; i < N; i++) for (int j = 0; j < N; j++) { ll dx = X[i] - X[j], dy = Y[i] - Y[j]; a.push_back(make_pair(dx * dx + dy * dy, i_i(i, j))); } sort(a.begin(), a.end()); union_find uf(N); ll ans = 0; for (int i = 0; ; i++) { if (uf.same(0, N - 1)) break; ll z = a[i].first, u = a[i].second.first, v = a[i].second.second; if (uf.same(u, v)) continue; ans = z; uf.unite(u, v); } ll unko; for (unko = 10; unko * unko < ans; unko += 10); cout << unko << endl; }