Two gentes are at war. Each gens sends a soldier to a duel. The soldiers who have been beat can’t join a duel again. If one gens can’t send the soldier, it lost the war. We know the gens A has n soldiers and the gens B has m soldiers. In each duel the soldier from the gens A has p probability to beat the soldier from the gens B. Calculate the probability that the gens A beat the gens B.
The input contains t (t<=15) test cases. Each of them contains two lines. The first line contains two integers n and m (1 <= n, m <= 500). The second line contains a real number p (0.0 <= p <= 1.0).
For each case, output the probability in a line. Your computed values are to be printed with four digits after the decimal point.
1 1 0.5 1 5 1.0
0.5000 1.0000