// Bismillah #include #include #include using namespace std; using namespace __gnu_pbds; #define nl cout << "\n"; #define YN(condition) cout << (condition ? "YES" : "NO") #define yn(condition) cout << (condition ? "Yes" : "No") #define int long long #define lint __int128 #define ll long long #define ld long double #define pii pair const int inf = 1e17; const int MOD = 1000000007; #define ac(n) array #define vi vector #define vb vector #define vc vector #define vs vector #define vpi vector> #define vvi vector> #define mp map #define pq priority_queue #define pqmin priority_queue, greater> #define pqminpair priority_queue, vector>, greater>> #define f(i, s, e) for (int i = s; i < e; i++) #define fn(i, s, e) for (int i = s; i >= e; i--) #define pb push_back #define pp pop_back #define all(s) s.begin(), s.end() #define sa(vec) sort(vec.begin(), vec.end()) #define sd(vec) sort(vec.begin(), vec.end(), [](int a, int b) { return a > b; }) template using ordered_set = tree< T, // key type null_type, // mapped type (null => set) less, // ordering rb_tree_tag, // red-black tree tree_order_statistics_node_update>; // .find_by_order(k) returns iterator of kth smallest element (0 based) // .order_of_key(k) returns number of elements < x template istream &operator>>(istream &in, pair &p) { in >> p.first >> p.second; return in; } template istream &operator>>(istream &in, vector &v) { for (auto &x : v) in >> x; return in; } template istream &operator>>(istream &in, vector> &vp) { for (auto &p : vp) in >> p.first >> p.second; return in; } template ostream &operator<<(ostream &out, const pair &p) { out << p.first << " " << p.second; return out; } template ostream &operator<<(ostream &out, const vector &v) { for (auto &x : v) out << x << " "; return out; } template ostream &operator<<(ostream &out, const vector> &vp) { for (auto &p : vp) out << p.first << " " << p.second << "\n"; return out; } #define fastnuces \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); \ int t = 1; int test = 0; void solve() { int x, y, l; cin >> x >> y >> l; int ans = 0; if (x == 0 and y == 0) { cout << 0; return; } if (x == 0) { if (y < 0) ans += 2; } else if (y == 0) { ans++; } else { if (x > 0 and y > 0) { ans++; } else if (x > 0 and y < 0) { ans += 2; } else if (x < 0 and y > 0) { ans++; } else if (x < 0 and y < 0) { ans += 2; } } ans += (abs(x) + l - 1) / l; ans += (abs(y) + l - 1) / l; cout << ans; } signed main() { fastnuces; // freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); // cin >> t; while (t--) { test++; solve(); nl } return 0; }