using System; using System.Linq; using System.Collections; using System.Collections.Generic; class Program { static void Main() { new Magatro().Solve(); } } public class Magatro { private int N; private long[] X, Y; private S[] Arr; private int[] Size; private int[] Par; private void Scan() { N = int.Parse(Console.ReadLine()); X = new long[N]; Y = new long[N]; for (int i = 0; i < N; i++) { var line = Console.ReadLine().Split(' '); X[i] = int.Parse(line[0]); Y[i] = int.Parse(line[1]); } } private void Union(S s) { Union(s.A, s.B); } private void Union(int a, int b) { a = Root(a); b = Root(b); if (a == b) return; Par[b] = a; Size[a] += Size[b]; } private bool Same(int a, int b) { return Root(a) == Root(b); } private int Root(int a) { if (Par[a] == a) return a; return Root(Par[a]); } public void Solve() { Scan(); int index = 0; Arr = new S[(N - 1) * N / 2]; for (int i = 0; i < N - 1; i++) { for (int j = i + 1; j < N; j++) { var dist = (X[i] - X[j]) * (X[i] - X[j]) + (Y[i] - Y[j]) * (Y[i] - Y[j]); Arr[index] = new S(i, j, dist); index++; } } Array.Sort(Arr, (a, b) => a.Dist.CompareTo(b.Dist)); Size = (new int[N]).Select(i => 1).ToArray(); Par = (new int[N]).Select((i, j) => j).ToArray(); int ind = 0; for (long l = 10; true; l += 10) { long dist = l * l; for (int i = ind; Arr[i].Dist < dist; i++) { ind++; Union(Arr[i]); if (Same(0, N - 1)) { Console.WriteLine(l); return; } } } } } struct S { public int A, B; public long Dist; public S(int a, int b, long dist) { A = a; B = b; Dist = dist; } }