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