#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair i_i; typedef pair ll_i; typedef pair d_i; typedef pair ll_ll; typedef pair d_d; struct edge { int u, v; ll w; }; ll MOD = 1000000007; ll _MOD = 1000000009; double EPS = 1e-10; int main() { int n; cin >> n; vector p(n), q(n); for (int i = 0; i < n; i++) { cin >> p[i]; p[i] /= 1000; } for (int i = 0; i < n; i++) { cin >> q[i]; q[i] /= 100; } double e = 0; priority_queue pq; for (int i = 0; i < n; i++) pq.push(d_i(p[i] * q[i], i)); for (int t = 1; t <= 5000000; t++) { d_i unko = pq.top(); pq.pop(); int i = unko.second; e += p[i] * q[i] * t; p[i] *= 1 - q[i]; pq.push(d_i(p[i] * q[i], i)); } cout << e << endl; }