m = 10**5; f = [0,0]+[1]*(m-1) for i in range(2,m+1): if f[i]: for j in range(i+i,m+1,i): f[j] = 0 for i in range(m): f[i+1] += f[i] for _ in range(int(input())): n,p,q = map(int,input().split()) print(f[n]*p/(f[n]*p+(n-f[n])*(100-q)))