#include "bits/stdc++.h" using namespace std; int main() { int N; cin >> N; vector A(N); vector B(N); for (int i = 0; i < N; i++) { cin >> A[i]; } for (int i = 0; i < N; i++) { cin >> B[i]; } vector NA(N); for (int i = 0; i < N; i++) { NA[i] = i; } int ok = 0; int count = 0; do{ int win = 0; for (int i = 0; i < N; i++) { if (A[NA[i]] > B[i]) win++; else win--; } if (win > 0) ok++; count++; } while (next_permutation(NA.begin(), NA.end())); printf("%.14f\n", (double)ok / count); }