using System; using System.Collections.Generic; using System.Linq; namespace PracticeAtCoder { class Program { static void Main(string[] args) { //048ロボット String sA = Console.ReadLine(); int iX = int.Parse(sA);//よこの距離 受け取り sA = Console.ReadLine(); int iY = int.Parse(sA);//たての距離 うけとり sA = Console.ReadLine(); int iA = int.Parse(sA);//ほはば うけとり int ansX = 0; int ansY = 0; iX = Math.Abs(iX); int iY2 = Math.Abs(iY); if(iX % iA != 0 ){ ansX =iX/iA +1; }else{ ansX =iX/iA; } if(iY2 % iA != 0 ){ ansY =iY2/iA +1; }else{ ansY =iY2/iA; } ansX = ansX +ansY; if(iY<0){ ansX = ansX+2; }else if(iX != 0){ ansX = ansX +1; } Console.WriteLine(ansX); } } }