#include #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; using ll = long long; using P = pair; int main() { int n; cin >> n; vector A(n); vector B(n); rep(i, n) { cin >> A[i]; } rep(i, n) { cin >> B[i]; } vector ind(n); rep(i, n) { ind[i] = i; } int all = 0, win = 0, a = 0; do { a = 0; rep(i, n) { if(A[ind[i]] > B[i]) a++; if(A[ind[i]] < B[i]) a--; } if (a > 0) win++; all++; } while (next_permutation(ind.begin(), ind.end())); cout << (double)win/all << endl; return 0; }