#include using namespace std; template inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } // #define MAX 4 int n; // int a[4]; // int b[4]; int factorial(int n) { int ret = 1; for (int i = 1; i <= n; i++) { ret *= i; } return ret; } int main() { cin >> n; vector a(n); vector b(n); for (int i = 0; i < n; i++) { cin >> a.at(i); } for (int i = 0; i < n; i++) { cin >> b.at(i); } sort(begin(a), end(a)); sort(begin(b), end(b)); int cnt = 0; do { do { int cnt2 = 0; for (int i = 0; i < n; i++) { if (a.at(i) > b.at(i)) { cnt2++; } } if (cnt2 > n / 2) { cnt++; } } while(next_permutation(begin(b), end(b))); sort(begin(b), end(b)); } while(next_permutation(begin(a), end(a))); double ans = cnt / pow(factorial(n), 2); cout << fixed << setprecision(2) << ans << endl; }