a,b,x,y=gets.split.map(&:to_f) p a*y>b*x ? x*(a+b)/a : y*(a+b)/b