#include using namespace std; using ll = long long; int main(){ int N; cin >> N; vector A(N), B(N); for(int &x: A)cin >> x; for(int &x: B)cin >> x; sort(A.begin(), A.end()); sort(B.begin(), B.end()); double awin = 0, game = 0;; do{ do{ int a = 0; for(int i = 0; i < N; i++)if(A[i] > B[i])a++; if(a > N / 2)awin++; game++; }while(next_permutation(B.begin(), B.end())); }while(next_permutation(A.begin(), A.end())); double pa = awin / game; cout << fixed << setprecision(10) << pa << endl; }