#include using namespace std; #define rep2(i, m, n) for(int i=int(m); i; using Vld = vector; int main() { ll n; cin >> n; Vld p(n), q(n); V a(n); rep(i, n) cin >> p[i]; rep(i, n) cin >> q[i]; rep(i, n) cin >> a[i]; // assert // const ld EPS = 1e-13; assert(n >= 1 && n <= int(1e5)); ld sum = 0; rep(i, n) { assert(p[i] + EPS >= 1e-6 && p[i] - EPS <= 1); sum += p[i]; assert(q[i] + EPS >= 0.6 && q[i] - EPS <= 0.9); assert(a[i] >= 0 && a[i] <= int(1e4)); } assert(sum - EPS <= 1 && sum + EPS >= 1); /////////// auto fun = [&] (ld y) { ld f = 0; rep(i, n) f += p[i] * (1-q[i]) / (1-q[i]*y); return (f <= y); }; ld ok = 1; ld ng = 0; rep(i, 30) { ld md = (ok + ng) / 2; if (fun(md)) ok = md; else ng = md; } ld ans = 0; rep(i, n) ans += a[i] * log((1-q[i]) / (1-q[i]*ok)); cout << ans << endl; return 0; }