#include #include #include #include #include #include using namespace std; int main() { int N; cin >> N; double PA, PB; cin >> PA >> PB; vector A(N), B(N); for (int i=0;i> A[i]; for (int i=0;i> B[i]; ranges::sort(A); ranges::sort(B); auto calc = [&](double P, vector>& cards) { // DP[ 状態S ] := 状態Sとなる確率 // cards[n][c] := n試合目でカードcを出す確率 vector DP(1 << N); DP[(1 << N) -1] = 1.0; for (int s=(1<