//H- n*(n+1)/2 * P + (n-1)*A <=0
#include<bits/stdc++.h>
#define LL long long int
using namespace std;
int main()
{
int t,cas=1;
scanf("%d",&t);
while(t--)
{
int h,p,a;
scanf("%d %d %d",&h,&p,&a);
LL lt=1,rt=1000000;
LL ans=0;
while(lt<=rt)
{
LL mid=(lt+rt)/2;
LL x=mid*(mid+1)/2;
if(h- x * p + (mid-1)*a <=0)
{
ans=mid;
lt=mid+1;
}
else
rt=mid-1;
}
printf("%lld\n",ans);
}
return 0;
}
Ly9ILSBuKihuKzEpLzIgKiBQICsgKG4tMSkqQSA8PTAKI2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KI2RlZmluZSBMTCBsb25nIGxvbmcgaW50CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpCnsKICAgIGludCB0LGNhcz0xOwoKICAgIHNjYW5mKCIlZCIsJnQpOwoKICAgIHdoaWxlKHQtLSkKICAgIHsKICAgICAgICBpbnQgaCxwLGE7CgogICAgICAgIHNjYW5mKCIlZCAlZCAlZCIsJmgsJnAsJmEpOwoKICAgICAgICBMTCBsdD0xLHJ0PTEwMDAwMDA7CiAgICAgICAgTEwgYW5zPTA7CgogICAgICAgIHdoaWxlKGx0PD1ydCkKICAgICAgICB7CiAgICAgICAgICAgIExMIG1pZD0obHQrcnQpLzI7CiAgICAgICAgICAgIExMIHg9bWlkKihtaWQrMSkvMjsKICAgICAgICAgICAgaWYoaC0geCAqIHAgKyAobWlkLTEpKmEgPD0wKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBhbnM9bWlkOwogICAgICAgICAgICAgICAgbHQ9bWlkKzE7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgcnQ9bWlkLTE7CiAgICAgICAgfQoKICAgICAgICBwcmludGYoIiVsbGRcbiIsYW5zKTsKICAgIH0KICAgIHJldHVybiAwOwp9Cg==