#include using namespace std; using ll = long long; using pii = pair; int main() { cin.tie(0); ios_base::sync_with_stdio(false); cout << fixed << setprecision(10); int N; cin >> N; vector a(N), b(N); for (int i = 0; i < N; i++) { cin >> a[i]; } for (int i = 0; i < N; i++) { cin >> b[i]; } sort(a.begin(), a.end()); sort(b.begin(), b.end()); int all = 0, win = 0; do { vector c = b; do { int num = 0; for (int i = 0; i < N; i++) { num += a[i] > c[i]; } win += num * 2 > N; all++; } while (next_permutation(c.begin(), c.end())); } while (next_permutation(a.begin(), a.end())); cout << 1. * win / all << endl; return 0; }