#include using namespace std; typedef long long ll; typedef pair pii; #define int long long const int maxn=2e5+5,mod=998244353,inf=0x3f3f3f3f; const double eps=1e-10; int t,n,m,p; signed main(){ scanf("%lld",&t); while(t--){ scanf("%lld%lld%lld",&n,&m,&p); int res=(100-p)*m/100,cnt=0; while(n>=m){ cnt+=n/m; n=n%m+n/m*res; } printf("%lld\n",cnt); } return 0; }