The first line of the input contains an integer $T$ denoting the number of test cases.
Each test case starts with a positive integer $n$ $(n \le 300, \sum{n} \le 1500)$, denoting the number of cards.
The second line contains two integers $p, q$ $(0 < p < q \le 10 ^ 9, \gcd(p, q) = 1)$, representing the probability.
The third line contains $n$ integers, the $i$-th integer represents the number $a_i$ $(1 \le a_i \le n)$ on the $i$-th card.