// No.48 ロボットの操縦 #include using namespace std; int main() { int X, Y, L; cin >> X >> Y >> L; if (Y > 0) { if (X != 0) cout << (abs(X) + L - 1) / L + (Y + L - 1) / L + 1 << endl; else cout << (Y + L - 1) / L << endl; } else if (Y < 0) { if (X != 0) cout << (abs(X) + L - 1) / L + (-Y + L - 1) / L + 2 << endl; else cout << (-Y + L - 1) / L + 1 << endl; } else { if (X != 0) cout << (abs(X) + L - 1) / L + 1 << endl; cout << 0 << endl; } }