N = gets.to_i A = gets.split.map(&:to_f) B = gets.split.map(&:to_f) ans = 0.0 N.times do |i| a, b = A[i], B[i] x1 = Math.sqrt([1, a / b].max) ans += a / x1 + b * x1 end puts ans