#include #include #include using namespace std; int main(){ int n; cin >> n; vector as(n), bs(n); for(int i=0; i> as[i]; for(int i=0; i> bs[i]; int num_play=0, win=0; sort(as.begin(), as.end()); do{ sort(bs.begin(), bs.end()); do{ int t=0; for(int i=0; ibs[i]; } ++num_play; win+=t>(n-t); }while(next_permutation(bs.begin(), bs.end())); }while(next_permutation(as.begin(), as.end())); cout << (double)win/num_play << endl; return 0; }