#include #include #include using namespace atcoder; using mint = modint1000000007; using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf 1000000000000000 int main(){ int n; cin>>n; vector p(n),q(n); rep(i,n){ cin>>p[i]; p[i] /= 1000.0; } rep(i,n){ cin>>q[i]; q[i] /= 100.0; } double ans = 0.0; double pp = 1.0; rep(_,420000){ ans += pp; int ind = 0; rep(i,n){ if(p[i]*q[i]>p[ind]*q[ind])ind = i; } pp *= 1.0 - p[ind]*q[ind]; p[ind] *= 1.0-q[ind]; double ps = 0.0; rep(i,n)ps += p[i]; if(ps<1e-10)break; rep(i,n){ p[i] = p[i] / ps; } } cout<