#include #define rep(i, n) for(long long i = 0; i < n; i++) #define ALL(v) (v).begin(), (v).end() #define rALL(v) (v).rbegin(), (v).rend() using namespace std; using lint = long long; using ld = long double; template struct Edge { int from, to; T cost; int idx; Edge() {} Edge(int to_) : to(to_) {} Edge(int to_, T cost_) : to(to_), cost(cost_) {} Edge(int from_, int to_, int idx_) : from(from_), to(to_), idx(idx_) {} Edge(int from_, int to_, T cost_, int idx_) : from(from_), to(to_), cost(cost_), idx(idx_) {} }; template using Graph = vector>>; using graph = Graph; using edge = Edge; #define add emplace_back int main() { int n; lint k; cin >> n >> k; vector h(n), x(n), y(n); rep(i, n) { cin >> h[i]; } rep(i, n) { cin >> x[i] >> y[i]; } graph g(n); rep(i, n) { rep(j, n) { if (i == j) { continue; } lint d = (x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]); if (h[i] < h[j] && d <= k * k) { g[i].add(j); } } } int ans = 0; rep(v, n) { if ((int)g[v].size() == 0) { ans++; } } cout << ans << endl; }