n,x,y=$<.map &:to_f x==1&&(p 1;exit) a=0 b=1 n.to_i.times{ a,b=a+b*b*x/(1-x*a),y*b/(1-x*a) } p a