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