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 tbl = [inf for i in range(N)] hq = [(0, 0)] while hq: c, u = heapq.heappop(hq) if tbl[u] != inf: continue tbl[u] = c for v in range(N): if tbl[v] != inf: continue heapq.heappush(hq, (c+(dis(u, v)-1)//ans_mid, v)) if tbl[1] <= K: ans_max = ans_mid else: ans_min = ans_mid print(ans_max)