fn read() -> T { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s.trim().parse().ok().unwrap() } fn main() { let x: i32 = read(); let y: i32 = read(); let l: i32 = read(); let get_step = |a: i32| { if a != 0 { if a % l != 0 { a.abs() / l + 1 } else { a.abs() / l } } else { 0 } }; let mut step = 0; if y >= 0 { step += get_step(y); if x != 0 { step += 1 + get_step(x); } } else { step += 1 + get_step(x) + 1 + get_step(y); } println!("{}", step); }