#include using namespace std; const int N_MAX = 100000; int main(){ cout << fixed << setprecision(20); int T; cin >> T; vector prime(N_MAX + 1, true); vector p; for (int i = 2; i <= N_MAX; i++){ if (prime[i]){ p.push_back(i); for (int j = i * 2; j <= N_MAX; j += i){ prime[j] = false; } } } for (int i = 0; i < T; i++){ int N, P, Q; cin >> N >> P >> Q; int cnt_prime = upper_bound(p.begin(), p.end(), N) - p.begin(); int cnt_comp = N - cnt_prime; double p = P * 0.01, q = Q * 0.01; cout << (p * cnt_prime) / (p * cnt_prime + (1 - q) * cnt_comp) << endl; } }