#include using namespace std; #define rep(i, a, n) for (int i = a; i < n; i++) using ll = long long; using ld = long double; using pl = pair; using vl = vector; using vvl = vector; using vb = vector; using vvb = vector; using vc = vector; using vvc = vector; const int mod = 998244353; const ll hashh = 2147483647; int main(){ ll n,point = 0; ld pt = 0,yes = 0; cin >> n; vl a(n),b(n); rep(i,0,n) cin >> a[i]; rep(i,0,n) cin >> b[i]; sort(a.begin(),a.end()); sort(b.begin(),b.end()); do{ do{ point = 0; rep(i,0,n){ if(a[i] > b[i]){ point++; } } pt++; if(point > n/2){ yes++; } }while(next_permutation(a.begin(),a.end())); }while(next_permutation(b.begin(),b.end())); printf("%.10Lf\n",yes/pt); return 0; }