//inlclude前用define #define _USE_MATH_DEFINES //include #include #include #include #include #include using namespace std; //typedef typedef vector VI; typedef vector VS; typedef vector VC; int main() { int x, y, l; cin >> x >> y >> l; int cnt = 0; if (y >= 0) { if (y%l == 0) cnt += y / l; else cnt += (y + l) / l; if (x != 0) { cnt++; x = abs(x); if (x%l == 0) cnt += x / l; else cnt += (x + l) / l; } } else { if (y < 0 && x!=0) cnt++; y = abs(y); x = abs(x); if (x != 0) cnt++; else if(y!=0) cnt += 2; if (y%l == 0)cnt += y / l; else cnt += (y + l) / l; if (x%l == 0)cnt += x / l; else cnt += (x + l) / l; } cout << cnt << endl; return 0; }