#include #include #include #include #include #include using namespace std; typedef long long LL; typedef pair PI; typedef vector VP; typedef pair PL; typedef vector VLL; typedef vector VVLL; #define x(_v) _v.first #define y(_v) _v.second #define cost(_v) _v.first #define to(_v) _v.second #define mp(_x,_y) make_pair(_x,_y) #define dist(_v,_u) (x(_v)-x(_u))*(x(_v)-x(_u))+(y(_v)-y(_u))*(y(_v)-y(_u)) const LL INF = 2*(LL)1e9; int main(){ int N; cin >> N; VP p(N); for (auto& v: p){ cin >> x(v) >> y(v); } VVLL edge(N, VLL(N)); for (int i = 0; i < N; i++){ for (int j = 0; j < N; j++){ edge[i][j] = dist(p[i], p[j]); } } priority_queue,greater> que; vector used(N, -1); que.push(mp(0, 0)); while (que.empty() == false){ auto v = que.top(); que.pop(); if (used[to(v)]>=0)continue; used[to(v)] = cost(v); for (int i = 0; i < N; i++){ if (to(v)!=i&&used[i]==-1){ que.push(mp(max(used[to(v)],edge[to(v)][i]), i)); } } } LL res = used[N - 1]; LL l = 0; LL h = INF; while (h - l > 1){ LL m = ((l + h) / 2)*10; if (res <= m*m)h = m / 10; else l = m / 10; } cout << h * 10 << endl; return 0; }