import heapq N, K = map(int, input().split()) sx, sy, gx, gy = map(int, input().split()) xy = [(sx, sy), (gx, gy)]+[tuple(map(int, input().split())) for i in range(N)] N += 2 ans_min = 0 ans_max = 2*10**5 def dis(i, j): return abs(xy[i][0]-xy[j][0])+abs(xy[i][1]-xy[j][1]) while ans_max-ans_min > 1: ans_mid = (ans_max+ans_min)//2 inf = -1 f = [False for i in range(N)] tbl = [2*10**5 for i in range(N)] hq = [(0, 0)] while hq: c, u = heapq.heappop(hq) if f[u]: continue f[u] = True for v in range(N): if f[v]: continue d = c+(dis(u, v)-1)//ans_mid if d < tbl[v]: tbl[v] = d heapq.heappush(hq, (d, v)) if tbl[1] <= K: ans_max = ans_mid else: ans_min = ans_mid print(ans_max)