#include <iostream> #include <string> #include <cstdio> #include <cmath> #include <cstring> #include <algorithm> #include <vector> #include <queue> #include <deque> #include <map> #define range(i,a,b) for(auto i=a;i<=b;++i) #define LL long long #define ULL unsigned long long #define elif else if #define itrange(i,a,b) for(auto i=a;i!=b;++i) #define rerange(i,a,b) for(auto i=a;i>=b;--i) #define fill(arr,tmp) memset(arr,tmp,sizeof(arr)) #define IOS ios::sync_with_stdio(false);cin.tie(0) using namespace std; int t,a,b,x,y; const double g=9.8; void init(){ scanf("%d",&t); } void solve(){ while(t--){ scanf("%d%d%d%d",&a,&b,&x,&y); double SIN=b*1.0/sqrt(a*a+b*b); double h=y+b*x*1.0/a,l=h*SIN+sqrt(x*x*(1+b*b*1.0/(a*a))); double TR=sqrt(2*l/(g*SIN)),T=sqrt(2*h/g); int cnt=int(TR/T),ans=(cnt+1)>>1; cout<<ans<<endl; } } int main() { init(); solve(); return 0; }