use std::io::{self, Read}; fn read_stdin() -> Vec { let mut buffer = String::new(); io::stdin().read_to_string(&mut buffer).ok(); buffer.trim().split('\n').map(|s| s.to_string()).collect() } fn main() { let input = read_stdin(); let mut cnt: usize = 0; let x = *&input[0].parse::().unwrap(); let y = *&input[1].parse::().unwrap(); if y < 0 { cnt += 2; } let mut pos = vec![x.abs(), y.abs()]; let l: isize = *&input[2].parse::().unwrap(); while *&pos[1] > 0 { pos[1] = *&pos[1] - l; cnt += 1; } if *&pos[0] != 0 { cnt += 1; } while *&pos[0] > 0 { pos[0] = *&pos[0] - l; cnt += 1; } println!("{}", cnt); }