#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
double get(int iC, int iB, int iP);
int main()
{
int n;
scanf("%d", &n);
int *pi = (int*)malloc(n*sizeof(int));
int ind=0;
int n1=n;
while(n--)
{
int iC,iB,iP;
int ans=0;
scanf("%d",&iC);
scanf("%d",&iB);
scanf("%d",&iP);
pi[ind]=(int)(get(iC,iB,iP));
ind++;
}
for(ind=0;ind<n1;ind++)
printf("%d\n",pi[ind]);
free(pi);
//printf("%d\n",xx);
getchar();
return 0;
}
double get(int iC, int iB, int iP)
{
double C=(double)(iC);
double B=(double)(iB);
double f=(double)(iP)/100.0;
double x= ceil(C*f);
if (x<C)
{
if(C-x>B)
{
x=C-B;
return x;
}else
{
return x;
}
}else
{
x=C-1;
double i=0;
double fd=0.0;
for(i=0;;i++)
{
fd= (C-1)/C + i/(i+B);
if(fd>=f)
break;
}
x=x+i;
return x;
}
}
test:
3
1 1 60
2 1 60
10 2 50
2
2
8
10
70 70 70
65 50 58
51 51 60
47 47 61
50 51 69
55 61 66
42 39 63
45 46 58
55 62 60
63 68 62
49
38
31
29
35
37
27
27
33
40