N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) P = [] Q = [] for a, b in zip(A, B): while P and P[-1] * Q[-1] >= a * b: a += P.pop() b += Q.pop() P.append(a) Q.append(b) ans = 0 for p, q in zip(P, Q): x = 0 if p > q: x = (p / q) ** .5 - 1 ans += p / (1 + x) ans += q * (1 + x) print("{:.13f}".format(ans))