import sys input = lambda :sys.stdin.readline()[:-1] ni = lambda :int(input()) na = lambda :list(map(int,input().split())) yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES") no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO") ##################################################################### n = ni() a = na() b = na() ans = 0 i = 0 while i < n: r = i A = 0 B = 0 while True: A += a[r] B += b[r] r += 1 if r == n: break if a[r] * b[i] > a[i] * b[r]: break x1 = max(A / B, 1)**0.5 ans += A/x1 + B * x1 i = r print(ans)