#include #include #include #include #include #include using namespace std; #define FOR(i,a,b) for (int i=(a);i<(b);i++) #define FORR(i,a,b) for (int i=(b)-1;i>=(a);i--) #define REP(i,n) for (int i=0;i<(n);i++) #define RREP(i,n) for (int i=(n)-1;i>=0;i--) #define pb push_back #define ALL(a) (a).begin(),(a).end() #define EPS (1e-10) #define EQ(a,b) (abs((a)-(b)) < EPS) #define PI 3.1415926535 typedef long long ll; //typedef pair P; //typedef complex C; struct edge { int from, to; ll cost; edge() {} edge(int f, int t, ll c) { from = f; to = t; cost = c; } }; bool cmp (const edge& e1, const edge& e2) { return e1.cost < e2.cost; } const int MAX_N = 1000; int N; ll X[MAX_N], Y[MAX_N]; vector es; int uni[MAX_N]; void input() { cin >> N; REP(i, N) cin >> X[i] >> Y[i]; } ll hyp(int i, int j) { return (X[i] - X[j]) * (X[i] - X[j]) + (Y[i] - Y[j]) * (Y[i] - Y[j]); } void initEdge() { REP(i, N) { FOR(j, i + 1, N) { ll dist = (ll)sqrt(hyp(i, j)); ll cost = dist - dist % 10; // 辺(i, j)を書くのに必要なものさしの長さ while (cost * cost < hyp(i, j)) cost += 10; es.pb(edge(i, j, cost)); es.pb(edge(j, i, cost)); } } } void initUf(int n) { REP(i, n) uni[i] = -1; } int root(int x) { if (uni[x] < 0) return x; return uni[x] = root(uni[x]); } bool same(int x, int y) { return root(x) == root(y); } void unite(int x, int y) { x = root(x); y = root(y); if (x == y) return; if (uni[x] > uni[y]) swap(x, y); uni[x] += uni[y]; uni[y] = x; } void solve() { initEdge(); sort(ALL(es), cmp); initUf(N); REP(i, es.size()) { edge e = es[i]; if (!same(e.from, e.to)) { unite(e.from, e.to); } if (same(0, N - 1)) { cout << e.cost << endl; return; } } } int main() { input(); solve(); return 0; }