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 r < n and a[r] * b[i] <= a[i] * b[r]: A += a[r] B += b[r] r += 1 x1 = max(A / B, 1)**0.5 ans += A/x1 + B * x1 i = r print(ans)