#include using namespace std; int main() { int N; int A[4],B[4]; cin >> N; for (int i = 0; i < N; i++) cin >> A[i]; for (int i = 0; i < N; i++) cin >> B[i]; sort(A, A + N); sort(B, B + N); int p = 0; int n = 0; do { do { p++; int m = 0; for (int i = 0; i < N; i++) { if (A[i] > B[i]) m++; } if (m > N - m) n++; } while (next_permutation(B, B + N)); } while (next_permutation(A, A + N)); cout << (double) n / p << endl; }