use std::collections::BTreeSet; fn g() -> Vec { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s.split_whitespace().flat_map(str::parse).collect() } fn main() { let n = g(); let mut p = g() .iter() .enumerate() .map(|(i, &p)| (p, i + 1)) .collect::>(); p.sort(); let mut b = BTreeSet::new(); for t in p.windows(2) { if t[1].0 - t[0].0 <= n[1] { b.insert(t[0].1); b.insert(t[1].1); } } let a = BTreeSet::from_iter(1..=n[0]); let a = a.difference(&b); println!( "{}\n{}", a.clone().count(), a.map(|&x| x.to_string()).collect::>().join(" ") ) }