if input = gets a, b, x, y = input.chomp.split.map{|s| s.to_i} if x * b >= a * y result = y + y * a / b.to_f else result = x + x * b / a.to_f end puts "%.7f" % result end