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) D = [[0] * (N + 2) for _ in range(N + 2)] for i in range(N + 2): for j in range(i + 1, N + 2): D[i][j] = abs(X[i] - X[j]) + abs(Y[i] - Y[j]) D[j][i] = abs(X[i] - X[j]) + abs(Y[i] - Y[j]) 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(i + 1, N + 2): di = -(-D[i][j] // P) - 1 G[i].append((j, di)) G[j].append((i, 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)