#include using namespace std; int main () { int N, K; cin >> N >> K; int X[555], Y[555]; for (int i = 0; i < N + 2; i ++) { cin >> X[i + 1] >> Y[i + 1]; } int ok = 2e5 + 5, ng = 0; using P = pair; while (abs(ok - ng) > 0) { int mu = (ok + ng) / 2; vector D(N + 2, 1e9 + 7); D[0] = 0; priority_queue, greater

> pque; pque.emplace(0, 0); while (!pque.empty()) { auto [l, u] = pque.top(); pque.pop(); if (l != D[u]) continue; for (int v = 1; v < N + 2; v ++) { int d = abs(X[v] - X[u]) + abs(Y[v] - Y[u]); d = (d + mu - 1) / mu; if (l + d < D[v]) { D[v] = l + d; pque.emplace(D[v], v); } } } if (D[1] <= K) { ok = mu; } else { ng = mu; } } cout << ok << endl; }