#include using namespace std; int main() { int N; cin >> N; vector a(N), b(N), perm(N); for (int i = 0; i < N; i++) cin >> a[i]; for (int i = 0; i < N; i++) cin >> b[i]; for (int i = 0; i < N; i++) perm[i] = i; int ptn =0, awin = 0; int cnt; do { ptn++; cnt = 0; for (int i = 0; i < N; i++) { if (a[perm[i]] > b[i]) cnt++; } if (cnt > N / 2) awin++; } while (next_permutation(perm.begin(), perm.end())); double ans = (double) awin / ptn; printf("%.2f\n", ans); }