class Prime(): def __init__(self, N): self.N = N self.Is_prime = [1 for i in range(N + 1)] self.Is_prime[0] = self.Is_prime[1] = 0 self.P = [] for p in range(2, N + 1): if self.Is_prime[p] == 0: continue self.P.append(p) for d in range(2, N//p + 1): self.Is_prime[p * d] = 0 q = 1 r = p while (p * d) % (p * r) == 0: q += 1 r *= p def is_prime(self, p): return self.Is_prime[p] def primelist(self): return self.P P = Prime(100000) C = [0 for i in range(100001)] for i in range(2, 100001): if P.is_prime(i): C[i] = 1 C[i] += C[i - 1] for i in range(int(input())): n, p, q = map(int, input().split()) if n == 1: print(0) continue if p == 0 and q == 100: print(0) continue x = p * C[n] y = (100 - q) * (n - C[n]) print(x / (x + y))