#include int n; double p[1001]; double q[1001]; int main(void) { int i; scanf("%d",&n); for( i = 0; i < n; i++ ) { int x; scanf("%d",&x); p[i] = x / 1000.0; } for( i = 0; i < n; i++ ) { int x; scanf("%d",&x); q[i] = x / 100.0; } for( i = 0; i < n; i++ ) p[i] *= q[i]; double exp = 0; double rem = 1.0; int c = 1; while(1) { double mp = p[0]; int mi = 0; for( i = 1; i < n; i++ ) { if( mp < p[i] ) { mi = i; mp = p[i]; } } exp += c * mp; rem -= mp; c++; if( rem * (c + exp) < exp * 1e-3 ) { exp = exp + rem * (c + exp); break; } p[mi] *= 1 - q[mi]; } printf("%5f\n",exp); return 0; }