#include using namespace std; using ll = long long; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b> N; vector A(N); FOR(i, 0, N){ cin >> A.at(i); } vector B(N); FOR(i, 0, N){ cin >> B.at(i); } std::random_device seed_gen; std::mt19937 engine(seed_gen()); ll count = 0; FOR(i, 0, 500000){ shuffle(ALL(A), engine); shuffle(ALL(B), engine); ll a_win = 0; ll b_win = 0; FOR(j, 0, N){ if(A[j]>B[j]){ a_win++; }else{ b_win++; } } if(a_win > b_win){ count++; } } cout << setprecision(20); p(count / 500000.0); return 0; }