#include // #ifndef ONLINE_JUDGE // #include "debug/debug_template.cpp" // #else // #define debug(...) // #define debugArr(...) // #endif #define ll long long #define nl "\n" #define vi vector #define vvi vector> #define int long long #define pii pair #define double long double #define pb push_back #define here cout << "HERE" << nl; #define forn(i, a, n) for (int i = a; i < n; i++) #define print(a) \ for (auto &e : a) \ cout << e << " "; \ cout << nl; #define all(a) a.begin(), a.end() #define MOD(a, b) ((a % b) + b) % b #define yesno(b) cout << ((b) ? "YES\n" : "NO\n") template using min_heap = std::priority_queue, std::greater>; using namespace std; void solve() { int x, y; cin >> x >> y; int l; cin >> l; int ans = 0; ans += abs(x / l); if (abs(x % l) != 0) ans++; ans += abs(y / l); if (abs(y % l) != 0) ans++; // rotation if (x != 0) { ans++; if(y<0)ans++; } else{ if(y<0)ans+=2; } cout<> t; while (t--) { solve(); } return 0; }