#define REP(i,n) for(int i=0; i<(int)(n); i++) #include #include inline int getInt(){ int s; scanf("%d", &s); return s; } #include using namespace std; int main(){ const int n = getInt(); vector p(n); vector q(n); REP(i,n) p[i] = getInt(); REP(i,n) q[i] = getInt(); priority_queue > pq; REP(i,n) pq.push(make_pair(p[i] / 1000.0 * q[i] / 100.0, q[i] / 100.0)); double ans = 0; REP(i,500000){ const pair d = pq.top(); pq.pop(); ans += (i + 1) * d.first; pq.push(make_pair(d.first * (1 - d.second), d.second)); } printf("%.10f\n", ans); return 0; }