#include using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { cin.tie(nullptr)->sync_with_stdio(false); int n; cin >> n; vector a(n), b(n); rep(i, n) cin >> a[i]; rep(i, n) cin >> b[i]; ranges::sort(a), ranges::sort(b); int ans = 0, cnt = 0; do { do { ++cnt; int pts = 0; rep(i, n) { if (a[i] > b[i]) ++pts; if (a[i] < b[i]) --pts; } ans += pts > 0; } while (next_permutation(b.begin(), b.end())); } while (next_permutation(a.begin(), a.end())); cout << fixed << setprecision(15) << (double) ans / cnt << '\n'; return 0; }