from math import log from scipy import optimize n = int(input()) p = list(map(float, input().split())) q = list(map(float, input().split())) a = list(map(int, input().split())) def f(x): return sum((1-q[i]) / (1-q[i]*x) for i in range(n)) - x def f_prime(x): return sum((1/q[i] - 1) / ((1/q[i] - x)**2) for i in range(n)) - 1 r = optimize.newton(f, 0, fprime=f_prime) #print(r) ans = 0 for i in range(n): ans += a[i] * log((1-q[i]) / (1-q[i]*r)) print(ans)