import java.util.Arrays; import java.util.HashSet; import java.util.LinkedList; import java.util.PriorityQueue; import java.util.Scanner; import java.util.Set; public class Main { public static class Node implements Comparable { int node; long max_dist; public Node(int node, long max_dist){ this.node = node; this.max_dist = max_dist; } @Override public int compareTo(Node o) { return Long.compare(this.max_dist, o.max_dist); } } public static void main(String[] args) { Scanner sc = new Scanner(System.in); final int N = sc.nextInt(); long[] xs = new long[N]; long[] ys = new long[N]; for(int i = 0; i < N; i++){ xs[i] = sc.nextLong(); ys[i] = sc.nextLong(); } long[] dists = new long[N]; Arrays.fill(dists, Long.MAX_VALUE); PriorityQueue queue = new PriorityQueue(); queue.add(new Node(0, 0)); while(!queue.isEmpty()){ final Node node = queue.poll(); if(dists[node.node] < node.max_dist){ continue; }else{ dists[node.node] = node.max_dist; } if(node.node == N - 1){ long sqrt = (long)(Math.sqrt(node.max_dist)); while(sqrt * sqrt < node.max_dist){ sqrt++; } System.out.println((sqrt + 9) / 10 * 10); //System.out.println(node.max_dist); //System.out.println((int)(Math.floor(Math.sqrt(node.max_dist)))); //System.out.println(((int)(Math.sqrt(node.max_dist)) + 9) / 10 * 10); break; } final long node_x = xs[node.node]; final long node_y = ys[node.node]; for(int next = 0; next < N; next++){ if(node.node == next){ continue; } final long next_x = xs[next]; final long next_y = ys[next]; final long next_dist = (node_x - next_x) * (node_x - next_x) + (node_y - next_y) * (node_y - next_y); final long next_max = Math.max(next_dist, node.max_dist); if(dists[next] <= next_max){ continue; }else{ dists[next] = next_max; queue.add(new Node(next, next_max)); } } } } }