a,b,c,d=gets.split.map &:to_f p [c+c*b/a,d+d*a/b].min