#include using namespace std; #define rep(i,n) for(int i=0; i &A, vector &B){ int cnt=0; if(n == 0){ if(wA > wB){ //cout << "aaa"<< wA <<" "<> i) & 1) continue; int new_flagA = flagA | (1 << i); rep(j,N){ if((flagB >> j) & 1) continue; int new_flagB = flagB | (1 << j); if(A[i] > B[j]){ cnt += solve(new_flagA, new_flagB, n-1, wA+1, wB, A, B); }else if(A[i] < B[j]){ cnt += solve(new_flagA, new_flagB, n-1, wA, wB+1, A, B); }else{ cnt += solve(new_flagA, new_flagB, n-1, wA, wB, A, B); } } } return cnt; } int func(int n){ if(n == 1){ return 1; }else{ return n*func(n-1); } } int main(){ cin >> N; vector A(N); vector B(N); map M; rep(i,N){ cin >> A[i]; } rep(i,N){ cin >> B[i]; } int nwin = solve(0, 0, N, 0, 0, A, B); cout<< double(nwin)/(func(N)*func(N)) <