#!/c/Python34/python # coding: utf-8 from queue import PriorityQueue from decimal import * def dist(i, j, xy): x1, y1 = xy[i] x2, y2 = xy[j] d = Decimal((x1-x2)**2+(y1-y2)**2).sqrt() if d - int(d) > 0: return int(d)+10-(int(d) % 10) else: if int(d) % 10 == 0: return int(d) else: return int(d)+10-(int(d) % 10) def main(): n = int(input()) xy = [list(map(int, input().split())) for _ in range(n)] L = [[dist(i, j, xy) for i in range(n)] for j in range(n)] que = PriorityQueue() inf = 10**19 S, G = 0, n-1 que.put([0, [S]]) ans = inf dm = [inf] * n while not que.empty(): e, v = que.get() e, t = int(e), int(v[-1]) dm[t] = min(dm[t], e) if t == G: ans = min(e, ans) continue for i in range(n): if i == t or dm[i] <= max(L[t][i], e): continue que.put([max(L[t][i], e), v+[i]]) print(ans) return if __name__ == '__main__': main()