#include using namespace std; int main() { int N; cin >> N; vector P(N), Q(N); for (int i = 0; i < N; i++) { cin >> P[i]; P[i] /= 1000; } for (int i = 0; i < N; i++) { cin >> Q[i]; Q[i] /= 100; } priority_queue> que; for (int i = 0; i < N; i++) { que.push({P[i] * Q[i], i}); } double ans = 0; int num = 1; while (num < 1e7) { auto p = que.top(); que.pop(); ans += num * p.first; p.first *= (1 - Q[p.second]); que.push(p); num++; } cout << fixed << setprecision(4) << ans << endl; }