#include #include using namespace std; using namespace atcoder; #define ALL(obj) (obj).begin(), (obj).end() #define rALL(obj) (obj).rbegin(), (obj).rend() using ll = long long; const int dx[4] = { 1, 0, -1, 0}, dy[4] = {0, 1, 0, -1}; const int INF = 1 << 30; const int mod = 1e9+7; vector> a; int main() { int N; cin >> N; vector A(N); for (int i = 0; i < N; i++) cin >> A[i]; vector B(N); for (int i = 0; i < N; i++) cin >> B[i]; vector ca(N); iota(ALL(ca), 0); int awin = 0, cnt = 0; do { int win = 0; for (int i = 0; i < N; i++) { if(A[ca[i]] > B[i]) win++; else win--; } if(win > 0) awin++; cnt++; } while(next_permutation(ALL(ca))); double ans; ans = 1.0* awin / cnt; printf("%.3lf\n", ans); return 0; }