#include using namespace std; typedef long long int64; #define SQR(a) ((int64)(a)*(int64)(a)) struct edge { int u, v; int64 cost; bool operator<(const edge& e) const { return(cost < e.cost); } }; struct UnionFind { vector< int > data; UnionFind(int sz){ data.assign(sz, -1); } int Find(int x){ return(data[x] < 0 ? x : data[x] = Find(data[x])); } void Unite(int a, int b) { a = Find(a), b = Find(b); if(a == b) return; if(data[a] < data[b]) swap(a, b); data[b] += data[a]; data[a] = b; } bool Same(int a, int b) { return(Find(a) == Find(b)); } }; int main() { int N, X[1000], Y[1000]; cin >> N; UnionFind uf(N); for(int i = 0; i < N; i++) { cin >> X[i] >> Y[i]; } vector< edge > edges; for(int i = 0; i < N; i++) { for(int j = i + 1; j < N; j++) { edges.push_back((edge){i, j, SQR(X[i] - X[j]) + SQR(Y[i] - Y[j])}); } } sort(edges.begin(), edges.end()); int64 ret = 0; for(int i = 0; i < N; i++) { edge& e = edges[i]; if(uf.Same(e.u, e.v)) continue; ret = e.cost; uf.Unite(e.u, e.v); if(uf.Same(0, N - 1)) break; } int64 low = 0, high = 1LL << 32; while(high - low > 0) { int64 mid = (low + high) >> 1LL; if(SQR(mid) >= ret) high = mid; else low = mid + 1; } cout << (low + 9) / 10 * 10 << endl; }