#include #include #include #include using namespace std; int main(){ int n; cin >> n; vector a(n), b(n); for(auto &p: a) cin >> p; for(auto &p: b) cin >> p; int total = 0; int win = 0; sort(a.begin(), a.end()); sort(b.begin(), b.end()); do{ //vector b(n); //for(int i = 0; i < n; i++) b[i] = b0[i]; do{ int awin = 0; for(int i = 0; i < n; i++){ if(a[i] > b[i]) awin++; } if(awin > n/2) win++; total++; }while(next_permutation(b.begin(), b.end())); }while(next_permutation(a.begin(), a.end())); cout << fixed << setprecision(10) << (long double)win/total << endl; return 0; }