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