using System; using System.Linq; class Program { static void Main(string[] args) { // No.48 ロボットの操縦 long X = long.Parse(Console.ReadLine()); long Y = long.Parse(Console.ReadLine()); long L = long.Parse(Console.ReadLine()); double moveCnt = 0; if (Y >= 0) { // 北側に進む場合 moveCnt += Math.Ceiling((double)Y / L); if (X != 0) { moveCnt++; // 進行方向変更 moveCnt += Math.Ceiling((double)Math.Abs(X) / L); } } else { // 南側に進む場合 if (X != 0) { moveCnt++; // 東西への進行方向変更 moveCnt += Math.Ceiling((double)Math.Abs(X) / L); } moveCnt++; moveCnt += Math.Ceiling((double)Math.Abs(Y) / L); } Console.WriteLine(moveCnt); } }