#include using namespace std; class UnionFind { private: int n; vector a; public: UnionFind(int n) : n(n), a(n, -1) {} int find(int x) {return a[x] < 0 ? x : (a[x] = find(a[x]));} bool equal(int x, int y) {return find(x) == find(y);} void unite(int x, int y) { x = find(x), y = find(y); if (x == y) return; if (a[x] > a[y]) swap(x, y); a[x] += a[y]; a[y] = x; --n; } int size() {return n;} int size(int x) {return -a[find(x)];} }; template inline T gcd(T a, T b) { return __gcd(a, b); } template inline T lcm(T a, T b) { return a / gcd(a, b) * b; } template inline T floor(T a, T b) { return floor(a / b) * b <= a ? floor(a / b) : floor(a / b) - 1; } template inline T ceil(T a, T b) { return floor(a + b - 1, b); } template inline T round(T a, T b) { return floor(a + b / 2); } template inline T mod(T a, T b) { return a - floor(a, b) * b; } template inline T factorial(T n) { return n <= 1 ? 1 : factorial(n - 1) * n; } template inline T square(T n) { return n * n; } template inline T cube(T n) { return n * n * n; } template inline T norm(T x1, T y1, T x2, T y2) { return square(x1 - x2) + square(y1 - y2); } inline long long sqrt(long long n) { int a = std::sqrt(n); while (a != n / a) a = (n / a + a) / 2; return a; } int main() { int n; cin >> n; vector> p(n); for (auto& i : p) cin >> get<0>(i) >> get<1>(i); vector> dis; for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { dis.emplace_back(make_tuple(norm(get<0>(p[i]), get<1>(p[i]), get<0>(p[j]), get<1>(p[j])), i, j)); } } sort(dis.begin(), dis.end()); UnionFind uf(n); for (const auto& d : dis) { uf.unite(get<1>(d), get<2>(d)); if (uf.equal(0, n - 1)) { cout << ceil(sqrt(get<0>(d) - 1) + 1, 10ll) * 10 << endl; return 0; } } }