N = 100000 def Eratosthenes(): isPrime = [False] * 2 + [True] * (N-1) i = 2 while i * i <= N: if isPrime[i]: for j in range(2*i, N+1, i): isPrime[j] = False i += 1 return isPrime isPrime = Eratosthenes() S = [0] for i in range(1, N+1): S.append(S[-1]+isPrime[i]) for t in range(int(input())): n, p, q = map(int, input().split()) print(S[n]*p / (S[n]*p + (n-S[n])*(100-q)))