#include using namespace std; using ll = long long; #define ALL(v) v.begin(),v.end() #define debug(x) cerr << #x << ": " << x << endl; const ll MOD = 1e9+7; const ll INF = 1LL << 60; void Yes(bool flag) { cout << (flag ? "Yes" : "No") << endl; } using pii = pair; template ostream& operator << (ostream& os, pair p) { return os << '(' << p.first << ',' << p.second << ')'; } template void print(Iter beg, Iter end) { for (Iter itr = beg; itr != end; ++itr) { cerr << *itr << ' '; } cerr << endl; } int N; vector A,B; int main() { cin >> N; A.resize(N); B.resize(N); for (auto& a : A) cin >> a; for (auto& b : B) cin >> b; sort(ALL(A)); sort(ALL(B)); int all = 0, win = 0; do { do { ++all; int cnt = 0; for (int i = 0; i < N; ++i) { if (A[i] > B[i]) ++cnt; } if (cnt > N / 2) ++win; } while (next_permutation(ALL(B))); } while (next_permutation(ALL(A))); cout << fixed << setprecision(6) << (double)win / all << endl; }