#include #define ll long long #define INF 1000000005 #define MOD 1000000007 #define EPS 1e-10 #define rep(i,n) for(int i=0;i<(int)n;++i) #define each(a, b) for(auto (a): (b)) #define all(v) (v).begin(),(v).end() #define fi first #define se second #define pb push_back #define show(x) cout <<#x<<" = "<<(x)<P; const int MAX_N = 100005; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; vector p(n); vector q(n); rep(i,n){ cin >> p[i]; p[i] /= 1000; } rep(i,n){ cin >> q[i]; q[i] /= 100; } priority_queue

que; rep(i,n){ que.push(P(p[i]*q[i],i)); } double prob = 0; double ans = 0; rep(i,100005){ P a = que.top(); que.pop(); ans += 1-prob; prob += a.fi; que.push(P(a.fi*(1-q[a.se]),a.se)); } printf("%.10lf\n",ans); return 0; }