from heapq import heapify, heappop, heappush n, k = map(int, input().split()) sx, sy, gx, gy = map(int, input().split()) P = [list(map(int, input().split())) for _ in range(n)] P = [[sx, sy]] + P + [[gx, gy]] D = [[0 for _ in range(n + 2)] for _ in range(n + 2)] for i in range(n + 2): for j in range(n + 2): D[i][j] = abs(P[i][0] - P[j][0]) + abs(P[i][1] - P[j][1]) INF = 10**18 l, r = 0, INF while r - l > 1: mid = (l + r) // 2 C = [INF for _ in range(n + 2)] C[0] = 0 H = [(0, 0)] while H: ccnt, cp = heappop(H) if cp == n + 1: break if ccnt > C[cp]: continue for np in range(n + 2): if np == cp: continue ncnt = ccnt + (D[cp][np] - 1) // mid if ncnt >= C[np]: continue C[np] = ncnt heappush(H, (C[np], np)) if C[n + 1] > k: l = mid else: r = mid print(r)