#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; for (int t = 1; t <= 500000; t++) { int _i = 0; for (int i = 0; i < n; i++) if (p[i] * q[i] > p[_i] * q[_i]) _i = i; e += p[_i] * q[_i] * t; p[_i] *= 1 - q[_i]; } cout << e << endl; }