#include using namespace std; void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); } int main() { fast_io(); const int M = 1e5 + 5; vector is_prime(M, true); is_prime[0] = is_prime[1] = false; for (int i = 2; i < M; i++) { if (is_prime[i]) { for (int j = i + i; j < M; j += i) { is_prime[j] = false; } } } vector pr(M, 0); { int cnt = 0; for (int i = 1; i < M; i++) { cnt += is_prime[i]; pr[i] = cnt / (double)i; } } int t; cin >> t; for (; t--;) { int n, P, Q; cin >> n >> P >> Q; double p = P * 0.01, q = Q * 0.01; double ans = p * pr[n] / (p * pr[n] + (1 - q) * (1 - pr[n])); cout << setprecision(16) << fixed << ans << "\n"; } }