n,K=map(int,input().split()) sx,sy,gx,gy=map(int,input().split()) sx,sy=sx+sy,sx-sy gx,gy=gx+gy,gx-gy p=[(sx,sy)] for i in range(n): x,y=map(int,input().split()) p+=[(x+y,x-y)] p+=[(gx,gy)] n+=2 ok=10**6 ng=0 from heapq import heappush,heappop while ok-ng>1: m=(ok+ng)//2 X=1<<60 v=[X]*n v[0]=0 q=[(v[0],0)] while len(q)>0: sc,sp=heappop(q) sx,sy=p[sp] if sc>v[sp]: continue for tp in range(n): tx,ty=p[tp] tc=max(max(abs(tx-sx),abs(ty-sy))-1,0)//m if v[tp]>sc+tc: v[tp]=sc+tc heappush(q,(v[tp],tp)) if v[-1]<=K: ok=m else: ng=m print(ok)