#include #include #include #include #include #define INF 1<<29 using namespace std; using Graph = vector>; using ll = long long; int main(void) { int n; cin >> n; vector a(n), b(n); for (auto& x : a ) { cin >> x; } for (auto& x : b) { cin >> x; } int cnt = 0; int ans = 0; int res = 0; sort(a.begin(), a.end()); sort(b.begin(), b.end()); do { do { res++; cnt = 0; for (int i = 0; i < n; i++) { if (a[i] > b[i])cnt++; } if (cnt > (n / 2))ans++; } while (next_permutation(b.begin(), b.end())); } while (next_permutation(a.begin(), a.end())); cout << (double)ans / res << endl; return 0; }