#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define BET(a,b,c) ((a)<=(b)&&(b)<(c)) #define FOR(i,n) for(int i=0,i##_end=(int(n));i VI; typedef vector VVI; long double dist(long long x, long long y){ long long D = x * x + y * y; long long sD = sqrt(D); double eps = 0; if(sD * sD != D) eps += 1e-3; return sqrt(D) + eps; } long long adjustDist(long long x, long long y){ long long D = x * x + y * y; long long r = sqrt(D); while(r * r < D) r++; while(r % 10) r++; return r; } struct DisjointSet { vector group ; DisjointSet(int n) : group(n, -1) { ; } bool unionSet(int x, int y) { x = root(x); y = root(y); if (x != y) { if (group[y] > group[x]) swap(x, y); group[x] += group[y]; group[y] = x; } return x != y; } bool is_sameSet(int x, int y) { return root(x) == root(y); } int root(int x) { return group[x] < 0 ? x : group[x] = root(group[x]); } int size(int x) { return -group[root(x)]; } }; int main() { int N; cin>>N; vector X(N); vector Y(N); FOR(i,N) cin>>X[i]>>Y[i]; vector > > edges; FOR(i,N){ FOR(j,i) edges.push_back(MP(dist(X[i]-X[j],Y[i]-Y[j]), MP(i,j))); } sort(ALL(edges)); DisjointSet D(N); long long ans = 0; for(const auto &e : edges){ int x = e.second.first; int y = e.second.second; if(D.unionSet(x, y)){ ans = adjustDist(X[x]-X[y],Y[x]-Y[y]); if(D.is_sameSet(0, N-1)) break; } } printf("%lld\n", ans); return 0; }