#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; class UnionFind { private: vector par; public: UnionFind(int N) { par.resize(N); iota(par.begin(), par.end(), 0); } int root(int x) { return par[x] == x ? x : par[x] = root(par[x]); } bool same(int x, int y) { return root(x) == root(y); } void unite(int x, int y) { if (same(x, y)) return; x = root(x); y = root(y); par[y] = 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> d2(n, vector(n)); for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) { d2[i][j] = (x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]); //printf("d2[%d][%d] = %lld\n", i, j, d2[i][j]); } long long ok = (long long)3e9; long long ng = 0; while (ng + 1 < ok) { long long x = (ok+ng)/2; UnionFind uf(n); for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) if (x*x >= d2[i][j]) uf.unite(i, j); if (uf.same(0, n-1)) ok = x; else ng = x; } cout << (ok+9) / 10 * 10 << endl; }