#include using namespace std; using ll = long long; using pll = pair; using pint = pair; constexpr double PI = 3.141592653589793; constexpr ll MOD = 1e9 + 7; constexpr ll mod = 998244353; constexpr ll INF = 1LL << 60; const vector dx = {1, 0, -1, 0}; const vector dy = {0, 1, 0, -1}; #define vec2d(T, name, n, m, ini) vector> name(n, vector(m, ini)) #define REP(i, e) rep(i, 0, e) #define rep(i, s, e) for (ll i = s; i < (e); ++i) #define rrep(i, s, e) for (ll i = s; i >= (e); --i) #define all(x) (x).begin(), (x).end() int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; vector a(n), b(n); REP(i, n) cin >> a[i]; REP(i, n) cin >> b[i]; sort(all(a)), sort(all(b)); double aWin = 0, cnt = 0; do { auto bCopy = b; do { ++cnt; int aTmp = 0, bTmp = 0; REP(i, n) { if (a[i] > bCopy[i]) ++aTmp; else ++bTmp; } if (aTmp > bTmp) ++aWin; } while (next_permutation(all(bCopy))); } while (next_permutation(all(a))); cout << fixed << setprecision(10) << aWin / cnt << "\n"; return 0; }