#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 using P = pair; P op(P a,P b){ return max(a,b); } P e(){ return make_pair(0.0,-1); } P mapping(double a,P b){ b.first *= a; return b; } double composition(double a,double b){ return a*b; } double id(){ return 1.0; } 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; vector

temp(n); rep(i,n)temp[i] = make_pair(p[i]*q[i],i); lazy_segtree seg(temp); rep(_,450000){ ans += pp; P r = seg.all_prod(); if(r.second==-1)break; pp *= 1.0 - r.first; double ps = 1.0; r.first /= q[r.second]; ps -= r.first; r.first *= 1.0 - q[r.second]; ps += r.first; r.first *= q[r.second]; seg.set(r.second,r); if(ps<1e-10)break; seg.apply(0,n,1.0 / ps); } cout<