#include using namespace std; typedef long long ll; int main () { 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]; } double game = 0; double wins = 0; do { do { int win = 0; int lose = 0; for (int i = 0; i < N; i++) { if (A[i] > B[i]) win ++; if (B[i] > A[i]) lose ++; } game ++; if (win > lose) wins ++; } while(next_permutation(B.begin(), B.end())); } while(next_permutation(A.begin(), A.end())); long double ans = wins; ans /= game; cout << fixed << setprecision(10); cout << ans << endl; return 0; }