#include using namespace std; int f(int n){ if(n == 1) return 1; else return n * f(n - 1); } int main(){ int n; cin >> n; vector a(n), b(n); for(int i = 0; i < n; i++) cin >> a[i]; for(int i = 0; i < n; i++) cin >> b[i]; sort(a.begin(), a.end()); sort(b.begin(), b.end()); int k = n / 2 + 1; int cnt = 0; int all = f(n) * f(n); do{ do{ int aw = 0; for(int i = 0; i < n; i++){ if(a[i] > b[i]) aw++; } if(aw >= k) cnt++; }while(next_permutation(a.begin(), a.end())); }while(next_permutation(b.begin(), b.end())); long double ans = (long double)cnt / all; cout << ans << endl; return 0; }