import java.util.Arrays; import java.util.PriorityQueue; import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int[] x = new int[n + 2]; int[] y = new int[n + 2]; x[0] = sc.nextInt(); y[0] = sc.nextInt(); x[n + 1] = sc.nextInt(); y[n + 1] = sc.nextInt(); for (int i = 1; i <= n; i++) { x[i] = sc.nextInt(); y[i] = sc.nextInt(); } sc.close(); int ok = 200000; int ng = 0; while (Math.abs(ok - ng) > 1) { int mid = (ok + ng) / 2; PriorityQueue que = new PriorityQueue(); Node first = new Node(0, 0); que.add(first); int[] d = new int[n + 2]; Arrays.fill(d, 1000000007); d[0] = 0; while (!que.isEmpty()) { Node cur = que.poll(); if (cur.d > d[cur.v]) { continue; } for (int next = 1; next <= n + 1; next++) { int v1 = Math.abs(x[cur.v] - x[next]) + Math.abs(y[cur.v] - y[next]); int alt = d[cur.v] + (v1 - 1) / mid; if (alt < d[next]) { d[next] = alt; que.add(new Node(next, alt)); } } } if (d[n + 1] <= k) { ok = mid; } else { ng = mid; } } System.out.println(ok); } static class Node implements Comparable { int v; long d; public Node(int v, long d) { this.v = v; this.d = d; } public int compareTo(Node o) { return Long.compare(d, o.d); } } }