2748The war between gentes

2748   The war between gentes

题目描述

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

说明

7
65
通过提交
时空限制1000ms/32mb
题目来源
评测方式在线评测
题目类型
难        度