#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define llint long long #define inf 1e18 #define rep(x, s, t) for(llint (x) = (s); (x) < (t); (x)++) #define Rep(x, s, t) for(llint (x) = (s); (x) <= (t); (x)++) #define chmin(x, y) (x) = min((x), (y)) #define chmax(x, y) (x) = max((x), (y)) #define mod 1000000007 using namespace std; typedef pair P; llint n; double p[100005], q[100005]; llint a[100005]; bool check(double P) { double sum = 0; for(int i = 1; i <= n; i++){ double mul = (1-q[i])/(1-q[i]*P); sum += mul * p[i]; } return sum <= P; } int main(void) { //ios::sync_with_stdio(0); //cin.tie(0); cin >> n; for(int i = 1; i <= n; i++) cin >> p[i]; for(int i = 1; i <= n; i++) cin >> q[i]; for(int i = 1; i <= n; i++) cin >> a[i]; double ub = 1, lb = 0, mid; for(int i = 0; i < 100; i++){ mid = (ub+lb)/2; if(check(mid)) ub = mid; else lb = mid; } double ans = 0; for(int i = 1; i <= n; i++){ double mul = (1-q[i])/(1-q[i]*ub); ans += a[i] * log(mul); } printf("%.11f\n", ans); return 0; }