#include #include #include #include #include using namespace std; #define LL long long void solve(){ LL a ,b ,x; scanf("%lld%lld%lld" ,&a ,&b ,&x); int Ans = 0; if(x > b){ double len = sqrt(x*x - b*b); double del = max(len * 2 ,1.0 * x); int repeat = a / del; Ans += repeat * 2 + 1; if(repeat * del + len <= a){ ++ Ans; double d = a - repeat * del - len; double c = b - sqrt(x*x - d*d); double l = a - repeat * del; if(c > 0 && l*l + c*c >= x*x) ++Ans; } printf("%d\n" ,Ans); } else{ // 这样就不会影响过去 int repeat = a / x; Ans += repeat + 1; double d = a - repeat * x; double c = sqrt(x*x - d*d); double B = b - c; repeat = B / x; Ans += repeat + 1; d = B - repeat * x; c = sqrt(x*x - d*d); double A = a - c; if(A >= 0) repeat = A / x ,Ans += repeat + 1; printf("%d\n" ,Ans); } } int main(){ int T; scanf("%d" ,&T); while(T--) solve(); return 0; }