#include #include #include #include #include #include using namespace std; #define rep(i,s,n) for(int i = s;i>n; vector a,b; rep(i,0,n){ int c; cin>>c; a.pb(c); } rep(i,0,n){ int c; cin>>c; b.pb(c); } sort(a.begin(),a.end()); int all=0; int win=0; do{ int c=0; rep(i,0,n){ if(a[i]>b[i]){ c++; } } all++; if(c>n-c){ win++; } }while(next_permutation(a.begin(),a.end())); cout<<1.*win/all<