a,b,x,y = gets.chomp.split(" ").map(&:to_i) if x / a > y / b puts x * (a + b) * 1.0 / a else puts y * (a + b) * 1.0 / b end