#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include template inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } using namespace std; #define int long long #define ll long long #define rep(i, n) for (ll i = 0; i < (n); i++) #define FOR(i,a,b) for(ll i=(a);i<(b);i++) #define FORR(i,a,b)for(ll i=(a);i<=(b);i++) #define repr(i,n) for(ll i=n;i>=0;i--) #define P pair #define sz(x) (ll)x.size() #define ALL(x) (x).begin(),(x).end() #define ALLR(x) (x).rbegin(),(x).rend() #define VE vector #define COUT(x) cout<<(x)< #define SE set #define PQ priority_queue #define PQR priority_queue> #define COUT(x) cout<<(x)<> n; VE a(n), b(n); rep(i, n)cin >> a[i]; rep(i, n)cin >> b[i]; sort(ALL(a)); sort(ALL(b)); double sum = 0; double cnt = 0; do { do { int now = 0; int now2 = 0; rep(i, n) { if (a[i] > b[i])now++; else now2++; } cnt++; if (now > now2)sum++; } while (next_permutation(ALL(b))); } while (next_permutation(ALL(a))); cout << fixed << setprecision(15) << sum / cnt << endl; return 0; }