#include using namespace std; typedef unsigned long long ll; typedef std::pair P; #define frep(i, a, b) for(int i = (a); i < (b); i++) #define rep(i, n) frep(i, 0, (n)) #define rrep(i, n) for(int i = (n - 1); i >= 0; i--) #define all(i, x) for(typeof(x.begin()) i = x.begin(); i != x.end(); i++) #define pb push_back const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1}; const int MAX = 1010; const int INF = 1e9; const int MOD = 1000000007; const string END = "\n"; struct UF{ int par[MAX], rank[MAX]; void init(int n){ rep(i, n){ par[i] = i; rank[i] = 0; } } int find(int x){ if(par[x] == x){ return x; // 一番上のノードの時 }else{ return par[x] = find(par[x]); // 上へ遡る } } void unite(int x, int y){ x = find(x); y = find(y); if(x == y) return; if(rank[x] < rank[y]){ par[x] = y; }else{ par[y] = x; if(rank[x] == rank[y]) rank[x] += 1; } } bool same(int x, int y){ return find(x) == find(y); } }; int n; ll x[MAX], y[MAX], d[MAX][MAX]; bool check(ll len){ UF uf; uf.init(n); rep(i, n) rep(j, n){ if(d[i][j] <= len * len){ uf.unite(i, j); } } return uf.same(0, n-1); } void solve(){ cin >> n; rep(i, n) cin >> x[i] >> y[i]; rep(i, n) rep(j, n){ d[i][j] = (x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]); } ll left = 0, right = 1e10; while(right - left > 1){ ll mid = (right + left) / 2; if(check(mid)){ right = mid; }else{ left = mid; } } ll ans = (right + 9) / 10 * 10; cout << ans << END; } int main(){ cin.tie(0); ios::sync_with_stdio(false); solve(); return 0; }