#include using namespace std; using ll = long long; #define rep(i, s, e) for (int i = (int)s; i < (int)e; ++i) #define all(a) (a).begin(), (a).end() ll sqdist(ll x1, ll y1, ll x2, ll y2) { return (x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2); } int main() { cin.tie(nullptr); ll N, K; cin >> N >> K; vector> H(N); vector X(N), Y(N); rep(i, 0, N) { cin >> H[i].first; H[i].second = i; } rep(i, 0 , N) cin >> X[i] >> Y[i]; sort(all(H)); int ans = N; rep(ii, 0, N - 1) rep(jj, ii + 1, N) { if (H[ii].first < H[jj].first) { int i = H[ii].second; int j = H[jj].second; if (sqdist(X[i], Y[i], X[j], Y[j]) <= K * K) { ans--; break; } } } cout << ans << '\n'; }