#![allow(dead_code, unused_imports, unused_macros, non_snake_case)] fn main() { input! { N: usize, K: i64, H: [i64; N], pos: [(i64, i64); N], } let mut ans = N; let mut order = (0 .. N).collect::>(); order.sort_by_key(|&i| H[i] ); for i in order { for j in 0 .. N { let (x1, y1) = pos[i]; let (x2, y2) = pos[j]; let dx = x1 - x2; let dy = y1 - y2; if H[i] < H[j] && dx * dx + dy * dy <= K * K { ans -= 1; break; } } } println!("{ans}"); } type Int = i64; const MOD: Int = 1_000_000_007; const INF: Int = 1_000_000_000; const YESNO: [&'static str; 2] = ["Yes", "No"]; use proconio::{input, marker::{Usize1, Chars}}; fn yes() { println!("{}", YESNO[0]); } fn no() { println!("{}", YESNO[1]); } fn yesno(c: bool) { println!("{}", if c { YESNO[0] } else { YESNO[1] }); }