#include #include using mint = atcoder::static_modint<998244353>; //using mint = atcoder::static_modint<1000000007>; using namespace std; using namespace atcoder; using ld = long double; using ll = long long; #define mp(a,b) make_pair(a,b) #define rep(i,s,n) for(int i=s; i dx{1,0,-1,0},dy{0,1,0,-1}; int main(){ int T; cin >> T; int m=100000; vector isprime(m+1,true); isprime[0]=false; isprime[1]=false; rep(i,2,m+1)if(isprime[i]){ for(int j=i<<1; j<=m; j+=i){ isprime[j]=false; } } vector pcnt(m+1); rep(i,2,m+1)pcnt[i]=pcnt[i-1]+isprime[i]; vector output; rep(t,0,T){ int n,p,q; cin >> n >> p >> q; ld total=0; total=(ld)pcnt[n]/n*p+(ld)(n-pcnt[n])/n*(100-q); ld x=(ld)pcnt[n]/n*p; output.push_back(x/total); } cout << setprecision(16); for(auto x:output)cout << x << "\n"; }