#include using namespace std; namespace { typedef double real; typedef long long ll; template ostream& operator<<(ostream& os, const vector& vs) { if (vs.empty()) return os << "[]"; auto i = vs.begin(); os << "[" << *i; for (++i; i != vs.end(); ++i) os << " " << *i; return os << "]"; } template istream& operator>>(istream& is, vector& vs) { for (auto it = vs.begin(); it != vs.end(); it++) is >> *it; return is; } int N; vector P, Q; void input() { cin >> N; P.resize(N); Q.resize(N); for (int i = 0; i < N; i++) { real p; cin >> p; p /= 1000; P[i] = p; } for (int i = 0; i < N; i++) { real q; cin >> q; q /= 100; Q[i] = q; } } struct S : pair { S(real a, int b) : pair(a, b) {} bool operator<(const S& o) const { return first * Q[second] < o.first * Q[o.second]; } }; void solve() { priority_queue PQ; for (int i = 0; i < N; i++) PQ.emplace(P[i], i); real ans = 1.0; real mother = 1.0; for (int t = 1; t <= 1000; t++) { auto pi = PQ.top(); PQ.pop(); real p = pi.first; real index = pi.second; real q = Q[index]; mother -= p * q; real np = p * (1.0 - q); ans += mother; PQ.emplace(np, index); } printf("%.12f\n", ans); } } int main() { input(); solve(); return 0; }