/* No.48 ロボットの操縦 https://yukicoder.me/problems/no/48 */ #include using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int dist = 0; int x, y, l; cin >> x >> y >> l; x = abs(x); y = abs(y); dist += (x / l); dist += (x % l); dist += (y / l); dist += (y % l); if (x != 0 && y != 0) dist += 1; cout << dist << endl; }