#include #include using namespace std; using namespace atcoder; using lint = long long; using ulint = unsigned long long; #define endl '\n' int const INF = 1<<30; lint const INF64 = 1LL<<61; // lint const mod = 1e9+7; // using mint = modint1000000007; long const mod = 998244353; using mint = modint998244353; lint ceilDiv(lint x, lint y){if(x >= 0){return (x+y-1)/y;}else{return x/y;}} lint floorDiv(lint x, lint y){if(x >= 0){return x/y;}else{return (x-y+1)/y;}} lint Sqrt(lint x){lint upper = 1e9;lint lower = 0;while(upper - lower > 0){lint mid = (1+upper + lower)/2;if(mid * mid > x){upper = mid-1;}else{lower = mid;}}return upper;} lint gcd(lint a,lint b){if(a&v){lint ans = INF64;for(lint i:v){ans = min(ans, i);}return ans;} lint chmax(vector&v){lint ans = -INF64;for(lint i:v){ans = max(ans, i);}return ans;} double dist(double x1, double y1, double x2, double y2){return sqrt(pow(x1-x2, 2) + pow(y1-y2,2));} string toString(lint n){string ans = "";if(n == 0){ans += "0";}else{while(n > 0){int a = n%10;char b = '0' + a;string c = "";c += b;n /= 10;ans = c + ans;}}return ans;} string toString(lint n, lint k){string ans = toString(n);string tmp = "";while(ans.length() + tmp.length() < k){tmp += "0";}return tmp + ans;} vectorprime;void makePrime(lint n){prime.push_back(2);for(lint i=3;i<=n;i+=2){bool chk = true;for(lint j=0;j>; int main(){ lint n,k; cin >> n >> k; lint sx,sy,gx,gy; cin >> sx >> sy >> gx >> gy; lint Sx = (sx + sy); lint Sy = (sx - sy); lint Gx = (gx + gy); lint Gy = (gx - gy); lint x[n+2], y[n+2]; lint X[n+2], Y[n+2]; rep(i, n) { cin >> x[i] >> y[i]; X[i] = x[i] + y[i]; Y[i] = x[i] - y[i]; } X[n] = Sx; X[n+1] = Gx; Y[n] = Sy; Y[n+1] = Gy; lint upper = INF64; lint lower = 1; while(upper > lower) { lint P = (upper + lower ) / 2; vec>dist(n+2, vec(n+2, INF64)); rep(i, n+2) dist[i][i] = 0; rep(i, n+2) { rep(j, n+2) { dist[i][j] = (max((abs(X[i] - X[j])), (abs(Y[i] - Y[j]))) - 1) / P; } } rep(kk, n+2) { rep(i, n+2) { rep(j, n+2) { dist[i][j] = min(dist[i][j], dist[i][kk] + dist[kk][j]); } } } // cout << "=========== " << P << " =========" << endl; // rep(i, n+2) { // rep(j, n+2) cout << dist[i][j] << " "; // cout << endl; // } if(dist[n][n+1] <= k) { upper = P; } else { lower = P +1; } } cout << upper << endl; }