#include #define rep(i,n) for(int i = 0; i < n; i++) #define pb push_back using namespace std; typedef long long ll; int main(){ int n; cin>>n; vector a(n),b(n); rep(i,n) cin>>a[i]; rep(i,n) cin>>b[i]; int res = 0; sort(a.begin(),a.end()); sort(b.begin(),b.end()); do{ do{ int win = 0; rep(i,n) if(a[i]>b[i]) win++; if(win > n/2) res++; }while(next_permutation(b.begin(),b.end())); }while(next_permutation(a.begin(),a.end())); double ans = (double)res; rep(i,n) ans /= (i+1)*(i+1); printf("%f\n",ans); }