#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //#include //#include //#include //#include //#include //#include //#include //#include //#include //#if __cplusplus >= 201103L //#include //#include //#include //#include // //#define cauto const auto& //#else //#endif using namespace std; typedef long long ll; typedef pair pii; typedef pair pll; typedef vector vint; typedef vector > vvint; typedef vector vll, vLL; typedef vector > vvll, vvLL; #define VV(T) vector > template void initvv(vector > &v, int a, int b, const T &t = T()){ v.assign(a, vector(b, t)); } template void convert(const F &f, T &t){ stringstream ss; ss << f; ss >> t; } #define reep(i,a,b) for(int i=(a);i<(b);++i) #define rep(i,n) reep((i),0,(n)) #define ALL(v) (v).begin(),(v).end() #define PB push_back #define F first #define S second #define mkp make_pair #define RALL(v) (v).rbegin(),(v).rend() // #define DEBUG #ifdef DEBUG #define dump(x) cout << #x << " = " << (x) << endl; #define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl; #else #define dump(x) #define debug(x) #endif #define MOD 1000000007LL #define EPS 1e-8 static const int INF=1<<24; void mainmain(){ int n; cin>>n; vector v1(n),v2(n); rep(i,n) cin>>v1[i]; rep(i,n) cin>>v2[i]; rep(i,n) v1[i]=v1[i]/1000.0; rep(i,n) v2[i]=v2[i]/100.0; priority_queue> pq; rep(i,n){ pq.push(mkp(v1[i]*v2[i],i)); } double ans=0.0; reep(i,1,1000000){ auto top=pq.top(); ans+=top.F*i; pq.pop(); top.F*=(1.0-v2[top.S]); pq.push(top); } printf("%.8lf\n",ans); } signed main() { mainmain(); }