#define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ALL(v) v.begin(), v.end() typedef long long ll; #include using namespace std; const ll INF=1LL<<60; struct Edge{ int to; ll w; Edge(int to,ll w) : to(to),w(w) {} }; using Graph=vector>; using pli=pair; template bool chmin(T& a,T b){ if(a>b){ a=b; return true; } return false; } vector dijkstra(int s,Graph &G){ int n=G.size(); vector dist(n,INF); dist[s]=0; priority_queue,greater> que; que.push({dist[s],s}); while(!que.empty()){ int v=que.top().second; ll d=que.top().first; que.pop(); if(d>dist[v]) continue; for(auto e:G[v]){ if(chmin(dist[e.to],dist[v]+e.w)){ que.push({dist[e.to],e.to}); } } } return dist; } int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); int n,k; cin>>n>>k; int sx,sy,gx,gy; cin>>sx>>sy>>gx>>gy; vector X(n+2),Y(n+2); X[0]=sx,Y[0]=sy; rep(i,n) cin>>X[i+1]>>Y[i+1]; X[n+1]=gx,Y[n+1]=gy; vector> D(n+2,vector(n+2)); rep(i,n+2){ rep(j,n+2) D[i][j]=abs(X[i]-X[j])+abs(Y[i]-Y[j]); } auto f=[&](int x)->int{ Graph G(n+2); rep(i,n+2){ for(int j=i+1;j dis=dijkstra(0,G); return dis[n+1]; }; int ok=200010,ng=0; while(ok-ng>1){ int mid=(ok+ng)/2; if(f(mid)<=k) ok=mid; else ng=mid; } cout<