use std::collections::HashMap; fn main() { let mut xx = String::new(); std::io::Read::read_to_string(&mut std::io::stdin(), &mut xx).ok(); let xx: Vec = xx.split_whitespace().flat_map(str::parse).collect(); let mut count = HashMap::new(); for &x in &xx[2..] { *count.entry(x).or_insert(0) += 1; } let mut answer = 0; for &x in &xx[2..] { answer += count.get(&(xx[1] - x)).unwrap_or(&0); } println!("{answer}"); }