#include #include #include using std::cout; using std::cin; using std::endl; void conutInstruction(int a, int b, int c) { int count; if ( a == 0 && b >= 0 ) count = 0; else count = 1; // move to x axis direction count += fabs(b / c); if ( b % c !=0 ) count++; //move to y axis direction count += fabs(a / c); if ( a % c != 0 ) count++; //think the signature if ( b < 0 ) count++; cout << count << endl; } int main(void) { int x,y,z; cin >> x >> y >> z; conutInstruction(x, y, z); return 0; }