#include using namespace std; int inf = 1001001001; bool chmin(int &x,int y) { if(x > y) { x = y; return true; } return false; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N,K; cin >> N >> K; int sx,sy,gx,gy; cin >> sx >> sy >> gx >> gy; vectorx(N+2),y(N+2); for(int i = 0; i < N; i++) { cin >> x[i] >> y[i]; } x[N] = sx,y[N] = sy; x[N+1] = gx,y[N+1] = gy; int l = 0,r = 1001001; while(l+1 < r) { int mid = (l+r)/2; vectordist(N+2,inf); dist[N] = 0; priority_queue,vector>,greater>>que; que.push({0,N}); while(!que.empty()) { paira = que.top(); que.pop(); if(dist[a.second] != a.first) continue; for(int i = 0; i < N+2; i++) { int nxt = abs(x[a.second]-x[i])+abs(y[a.second]-y[i]); nxt = (nxt-1)/mid+a.first; if(chmin(dist[i],nxt)) { que.push({nxt,i}); } } } if(dist[N+1] <= K) { r = mid; } else { l = mid; } } cout << r << "\n"; }