from itertools import accumulate Primes_MAX = 10 ** 5 + 100 Primes = [] Sieve = [0] * Primes_MAX Sieve[0] = Sieve[1] = -1 for p in range(2, Primes_MAX): if not Sieve[p]: Primes.append(p) Sieve[p] = p for q in range(p * p, Primes_MAX, p): if not Sieve[q]: Sieve[q] = p acc = [0] * Primes_MAX for p in Primes: acc[p] += 1 acc = list(accumulate(acc)) for _ in range(int(input())): n, p, q = map(int, input().split()) scc = acc[n] / n * p / 100 fail = (1 - acc[n] / n) * (1 - q / 100) print(f'{scc / (scc + fail):.10f}')