class UnionFind: def __init__(self): self.N = 0 self.parent = [] self.rank = [] def __init__(self, NN): self.N = NN + 1 self.parent = [i for i in range(self.N)] self.rank = [0]*self.N def root(self, aa): if self.parent[aa] == aa: return aa self.parent[aa] = self.root(self.parent[aa]) return self.parent[aa] def sameroot(self, aa, bb): return self.root(aa) == self.root(bb) def unite(self, aa, bb): aa = self.root(aa) bb = self.root(bb) if aa == bb: #no need to unite anymore return if self.rank[aa] < self.rank[bb]: aa, bb = bb, aa if self.rank[aa] == self.rank[bb]: self.rank[aa] += 1 self.parent[bb] = aa N = int(input()) point = [] dist = [] for i in range(N): x, y = map(int, input().split()) point.append((x, y)) for k in range(i): xk, yk = point[k] dd = (xk-x)*(xk-x) + (yk-y)*(yk-y) dist.append((dd, i, k)) #sorted from short to long sortedD = sorted(dist, key=lambda tup: tup[0]) cnt = 0 tree = UnionFind(N) for (d, i, k) in sortedD: tree.unite(i, k) #connected? and be the shortest path if tree.sameroot(0, N-1): dd = int(d**0.5) while dd*dd < d: dd += 1 print(((dd + 9)//10)*10) exit(0)