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