import heapq N, K = map(int, input().split()) sx, sy, gx, gy = map(int, input().split()) X = [sx, gx] Y = [sy, gy] for i in range(N): x, y = map(int, input().split()) X.append(x) Y.append(y) def dijkstra(start, G): INF = 10**9 dist = [INF] * len(G) hq = [(0, start)] heapq.heapify(hq) dist[start] = 0 while hq: v = heapq.heappop(hq)[1] for u, cost in G[v]: if dist[v] + cost < dist[u]: dist[u] = dist[v] + cost heapq.heappush(hq, (dist[u], u)) return dist def solve(P): G = [[] for _ in range(N + 2)] for i in range(N + 2): for j in range(N + 2): if i == j: continue D = abs(X[i] - X[j]) + abs(Y[i] - Y[j]) di = -(-D // P) - 1 G[i].append((j, di)) dist = dijkstra(0, G) return dist[1] <= K ng, ok = 0, 2 * 10**5 + 10 while ok - ng > 1: mid = (ng + ok) // 2 if solve(mid): ok = mid else: ng = mid print(ok)