#include #include void main(){ //X座標 int x = 0,y = 0,l = 0; int input = scanf("%d\n%d\n%d\n",&x,&y,&l); if(input == 2){ printf("入力ミス\n"); } printf("(%d,%d) 移動距離:%d\n",x,y,l); //命令回数 int instructionCount = 0; //現在位置 int trueX = 0 , trueY = 0; if( y < 0){ instructionCount += 2; y *= -1; }else if(x != 0){ instructionCount += 1; if(x < 0){ x *= -1; } } while(x > 0 || y > 0){ if(y >= 0){ y -= l; instructionCount ++; continue; } if(x >= 0){ x -= l; instructionCount ++; continue; } } printf("%d\n",instructionCount); }