#include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int n = 100000; vector prime(n+1,1); prime.at(0) = 0; prime.at(1) = 0; for(int i=2; i*i<=n; i++){ if(prime.at(i) == 0) continue; for(int k=i*i; k<=n; k+=i) prime.at(k) = 0; } for(int i=1; i<=n; i++) prime.at(i) += prime.at(i-1); int T; cin >> T; while(T--){ int N,P,Q; cin >> N >> P >> Q; int p = prime.at(N),q = N-p; int Yp = p*P,Yq = q*(100-Q); cout << fixed << setprecision(20) << (Yp+0.0)/(Yp+Yq) << "\n"; } }