#include #define rep(i, n) for(int i = 0; i < (n); i++) using namespace std; int main(){ int n; cin >> n; int a[n], b[n]; rep(i, n) cin >> a[i]; rep(i, n) cin >> b[i]; sort(a, a+n); sort(b, b+n); int ans = 0; do{ do{ int awin = 0; int bwin = 0; rep(j, n){ if(a[j] > b[j]) awin++; else if(a[j] < b[j]) bwin++; } if(awin > bwin) ans++; }while(next_permutation(b, b+n)); }while(next_permutation(a, a+n)); int nn = 1; rep(i, n) nn *= (i+1); cout << (double(ans)/(nn*nn)) << endl; return 0; }