use proconio::marker::Chars; fn main() { proconio::input! { w: u64, d: u64, } println!("{}", proc(w, d)); } fn proc(w: u64, d: u64) -> u64 { let mut w = w; for d in (2..=d).rev() { w -= w / (d * d); } w } #[cfg(test)] mod test { use super::*; #[test] fn test() { assert_eq!(proc(2, 5), 3); } }