use std::collections::{HashMap, HashSet}; fn main() { proconio::input! { x:i32, y:i32, } let mut v = HashSet::new(); v.insert((0, 0)); for i in 0..3 { let mut next_v = v.clone(); for (x, y) in v { for val in [ (x - 2, y - 1), (x - 2, y + 1), (x - 1, y - 2), (x - 1, y + 2), (x + 1, y - 2), (x + 1, y + 2), (x + 2, y - 1), (x + 2, y + 1), ] { next_v.insert(val); } } v = next_v; } eprintln!("{v:?}"); if v.contains(&(x, y)) { println!("YES"); } else { println!("NO"); } }