fn main() { let x: i32 = read::().abs(); let y: i32 = read::().abs(); let l: i32 = read(); let div_ceil = |a: &i32, b: &i32| -> i32 { if a % b == 0 { a / b } else { a / b + 1 } }; //原点の場合 if x == 0 && y == 0 { println!("0"); } //軸上の場合 else if x == 0 { println!("{}", div_ceil(&y, &l)); } else if y == 0 { println!("{}", div_ceil(&x, &l) + 1); } else if y > 0 { println!("{}", div_ceil(&x, &l) + div_ceil(&y, &l) + 1) } else { println!("{}", div_ceil(&x, &l) + div_ceil(&y, &l) + 2) } } fn read() -> T { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s.trim().parse().ok().unwrap() } fn read_vec() -> Vec { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s.trim().split_whitespace() .map(|e| e.parse().ok().unwrap()).collect() }