#include using namespace std; void potato() { int n; cin >> n; vector a(n), b(n); for(auto& x : a) cin >> x; for(auto& x : b) cin >> x; sort(a.begin(), a.end()); sort(b.begin(), b.end()); double wins = 0, rounds = 0; do { do { int aw = 0, bw = 0; for(int i = 0; i < n; i++) { if(a[i] > b[i]) aw++; else bw++; } if(aw > bw) wins++; rounds++; } while(next_permutation(b.begin(), b.end())); } while(next_permutation(a.begin(), a.end())); double ans = wins / rounds; printf("%.6lf\n", ans); } signed main() { ios::sync_with_stdio(false); cin.tie(0); int tt=1; while(tt--) potato(); return 0; }