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