#include using namespace std; using ll = long long int; using ld = long double; const int INF = 1 << 29; const ll LINF = 1l << 61; const ld PI = abs(acos(-1)); #define pq priotity_queue #define mp make_pair #define P pair #define rep(i, a, b) for (ll i = (a); i < (b); i++) #define rrep(i, a, b) for (ll i = (a); i >= (b); i--) #define cbuf(buf, init) memset(buf, init, sizeof(buf)) #define modp(x, y) (((y) + (x) % (y)) % (y)) #define divd(x, y) (static_cast(x) / static_cast(y)) #define sq(x) (x) * (x) template class UnionFind { public: using type = ll; // must be integer type private: std::array parent_, rank_; public: UnionFind() { for (ll i = 0; i < SIZE; i++) { parent_[i] = i; rank_[i] = 0; } } ll operator[](ll x) { if (parent_[x] == x) return x; else return parent_[x] = (*this)[parent_[x]]; } void unite(ll x, ll y) { x = (*this)[x]; y = (*this)[y]; if (x == y) return; if (rank_[x] < rank_[y]) { parent_[x] = y; } else { parent_[y] = x; if (rank_[x] == rank_[y]) rank_[x]++; } } }; ll N, X[2000], Y[2000]; /* bool C(ll l) { UnionFind<2000> uf; rep(i, 0, N) { rep(j, 0, N) { if (sq(X[j] - X[i]) + sq(Y[j] - Y[i]) <= sq(l)) uf.unite(i, j); } } return (uf[0] == uf[N - 1]); } */ bool used[2000]; bool dfs(ll now, ll l) { if (now == N - 1) return true; used[now] = true; rep(i, 0, N) { if (used[i] || sq(X[now] - X[i]) + sq(Y[now] - Y[i]) > sq(l)) continue; if (dfs(i, l)) { return true; } } return false; } bool C(ll l) { cbuf(used, false); return dfs(0, l); } int main() { // cin >> N; rep(i, 0, N) { cin >> X[i] >> Y[i]; } ll lb = 0, ub = 2E9; while (ub - lb > 1) { ll mid = (lb + ub) / 2; mid = mid / 10 * 10; if (mid == lb) break; if (C(mid)) ub = mid; else lb = mid; } cout << ub << endl; }