#include #include #include using namespace std; using ll = long long; ll d2(ll x1, ll y1, ll x2, ll y2){ return (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1); } int main(){ int n; ll k; cin >> n >> k; vector h(n); for (ll &i: h) cin >> i; vector x(n), y(n); for (int i = 0; i < n; i++){ cin >> x[i] >> y[i]; } vector ind(n); for (int i = 0; i < n; i++) ind[i] = i; sort(ind.begin(), ind.end(), [&](int a, int b) { return h[a] < h[b]; }); int ans = 0; for (int i = 0; i < n; i++){ int a = ind[i]; bool ok = true; for (int j = i + 1; j < n; j++){ int b = ind[j]; if (h[a] == h[b]) continue; if (d2(x[a], y[a], x[b], y[b]) <= k * k){ ok = false; break; } } if (ok) ans++; } cout << ans << endl; }