fn main() { let mut nk = String::new(); std::io::stdin().read_line(&mut nk).ok(); let nk: Vec = nk.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let n = nk[0]; let k = nk[1]; if k == 0 { println!("1"); return; } let summary = n * (n+1) / 2; let k = summary - k; let mut ridx = 1usize; let mut summary = 1usize; for i in 0..n { while ridx < n && summary < k { ridx += 1; summary += ridx; } if summary == k { println!("1"); return; } summary -= i + 1; } println!("2"); }