#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; using ld = long double; using P = pair; using Graph = vector>; int dx[] = {0, 1, 0, -1, 1, 1, -1, -1}; int dy[] = {1, 0, -1, 0, 1, -1, 1, -1}; #define rep(i, N) for(int i = 0; i < N; i++) #define rep2(i, l, r) for (ll i = (ll)l; i < (ll)(r); i++) #define INF 1000000000 #define MAX 200001 #define PI 3.141592653589793 #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") const ll MOD = 1000000007; template inline string toString(const T &a) {ostringstream oss; oss << a; return oss.str();}; int main(){ int N; cin >> N; vector A(N),B(N); rep(i,N) cin >> A[i]; rep(i,N) cin >> B[i]; sort(A.begin(),A.end()); sort(B.begin(),B.end()); double shiai = 0; double win = 0; do{ do{ int win_cnt = 0; int lose_cnt = 0; rep(i,N){ if(A[i] > B[i]) win_cnt++; else lose_cnt++; } if(win_cnt > lose_cnt) win++; shiai++; }while(next_permutation(B.begin(),B.end())); }while(next_permutation(A.begin(),A.end())); cout << win / shiai << endl; }