#include using namespace std; int action (int num, int l) { int count = 0; if (num >= l) { count += num/l; num = num % l; } count += num; cout << count << endl; return count; } int main () { int x, y, l; cin >> x >> y >> l; int count = 0; if (y>0 && x!=0) count = 1; else if (y<0 && x!=0) count = 2; if (x < 0) x *= -1; if (y < 0) y *= -1; count += action(y,l)+action(x,l); cout << count << endl; return 0; }