#include #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(),(x).end() #define eb emplace_back using namespace std; using ll = long long; using ld = long double; using vl = vector; using vvl = vector>; using vs = vector; using pl = pair; template inline bool chmin(T& a, const T& b) {bool compare = a > b; if (a > b) a = b; return compare;} template inline bool chmax(T& a, const T& b) {bool compare = a < b; if (a < b) a = b; return compare;} templateusing rp_queue=priority_queue,greater>; template T gcd(T a, T b) {if (b == 0)return a; else return gcd(b, a % b);} template inline T lcm(T a, T b) {return a /gcd(a, b)*b;} const ll INF = 1LL << 60; const ld PI = acos(-1); void solve(){ int N;cin>>N; vl A(N);rep(i,N)cin>>A[i]; sort(all(A)); vl B(N);rep(i,N)cin>>B[i]; sort(all(B)); ll ansa = 0,ansb=0; do{ do{ ll a=0,b=0; rep(i,N){ if(A[i]>B[i])a++; else b++; } if(a>b)ansa++; else ansb++; }while(next_permutation(all(B))); }while(next_permutation(all(A))); ll x = ansa+ansb; cout<<((long double)ansa/(long double)x)<> num_tc; rep(tc,num_tc){ //cout << "Case #" << tc+1 << ": " ;// << endl; solve(); } }