##define INF 0x3f3f3f3f ##define lowbit(x) x & (-x) ##define mem(a, b) memset(a , b , sizeof(a)) ##define FOR(i, x, n) for(int i = x;i <= n; i++)
// const ll mod = 998244353; // const ll mod = 1e9 + 7; // const double eps = 1e-6; // const double PI = acos(-1); // const double R = 0.57721566490153286060651209; ll n, m; double p;
doublequick_pow(double a, int b){ double ans = 1; while(b) { if(b & 1) ans = ans * a; a = a * a; b >>= 1; } return ans; }
doubleClac(int k){ return (k * n + m) / (1 - quick_pow(1 - p, k)); }
voidsolve(){ int _; scanf("%d",&_); while(_--) { scanf("%lld%lld%lf",&n,&m,&p); p *= 0.0001; int l = 1, r = 100000; double ans = (n + m) / p; while(r - l >= 10) { int mid1 = l + (r - l) / 3; int mid2 = r - (r - l) / 3; if(Clac(mid1) < Clac(mid2)) r = mid2; else l = mid1; } for(int i = l;i <= r; i++) { ans = min(ans, Clac(i)); } printf("%lf\n",ans); } }