M,K=map(int, input().split())
sx,sy,gx,gy=map(int, input().split())
A=[]
A.append((sx,sy))
for i in range(M):
  x,y=map(int, input().split())
  A.append((x,y))
A.append((gx,gy))
D=[[10**10]*len(A) for i in range(len(A))]
for i in range(len(A)):
  for j in range(len(A)):
    d=abs(A[i][0]-A[j][0])+abs(A[i][1]-A[j][1])
    D[i][j]=d 
    
N=M+2
import heapq
def dijkstra(s,p):
    hq=[(0,s,0)]
    ans=[]
    heapq.heapify(hq) # リストを優先度付きキューに変換
    cost=[10**6]*N # 行ったことのないところはinf
    cost[s]=0 # 開始地点は0
    while hq:
      c,v,pre=heapq.heappop(hq)
      if c>cost[v]: # コストが現在のコストよりも高ければスルー v:now u:nex
        continue
      for u in range(N):
        if pre==u:
          continue
        if D[u][v]%p==0:
          d=D[u][v]//p-1 
        else:
          d=D[u][v]//p
        d=max(d,0)
        tmp=d+cost[v]
        if tmp<cost[u]:
          cost[u]=tmp
          heapq.heappush(hq,(tmp,u,v))
    return cost

ng,ok=0,2*10**5
while ok-ng>1:
  mid=(ok+ng)//2
  c=dijkstra(0,mid)[-1]
  if c>K:
    ng=mid 
  else:
    ok=mid
print(ok)