In WeirdLand, each couple continues to have children until they have at least x boys and at least y girls. As soon as they have at least x boys and y girls, they stop having children. The chance of having a girl is g per billion (109), while a boy's chance is (109 - g) per billion. Assuming an infinite number of couples, determine the following ratio:
$\frac{Expected\ number\ of\ boys}{Expected\ number\ of\ girls}$
Output the ratio as a simplified fraction with coprime positive numerator and denominator. Always include the denominator, even if it is 1.Input
The first line will contain a single integer T (1 ≤ T ≤ 104). Each test case will have three integers x, y, g (0 ≤ x, y ≤ 109, 1 ≤ g < 109). It is guaranteed that both x and y will not be 0 at the same time.
Output
Print the case number in a single line followed by the ratio. Please see the sample for details.
Sample
Sample Input | Sample Output |
---|---|
2 1 1 500000000 10 10 500000000 | Case 1: 1/1 Case 2: 1/1 |
Notes
Contest: NCPC 2023 Onsite Hosted by JU
Problem setter: Tanzir Pial