L=200000 cp=[1]*(L+1) cp[0]=0 cp[1]=0 for i in range(2,L+1): if cp[i]: for j in range(i+i,L+1,i): cp[j]=0 for i in range(1,L+1): cp[i]+=cp[i-1] T=int(input()) for _ in range(T): n,p,q=map(int,input().split()) a=cp[n] b=n-a p/=100 q/=100 p1=(a/n)*p p2=(b/n)*(1-q) print(p1/(p1+p2))