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 solve(P): G = [[] for _ in range(N+2)] for i in range(N+2): for j in range(N+2): if i == j: continue kyori = abs(X[i]-X[j]) + abs(Y[i]-Y[j]) di = kyori//P if kyori % P == 0: di -= 1 G[i].append((j, di)) dist = [-1]*(N+2) que = [(0,0)] heapq.heapify(que) while que: d, v = heapq.heappop(que) if dist[v] > -1: continue dist[v] = d for u,e in G[v]: if dist[u] > -1: continue heapq.heappush(que, (d+e, u)) # print(P, G, dist) return dist[1] <= K ng,ok = 1, 10**5+1 while ok-ng > 1: mid = (ng + ok) // 2 if solve(mid): ok = mid else: ng = mid print(ok)