National Olympiad in Informatics, China, 2006
Pòlya received a magical bag with symbols written on it that are difficult for humans to understand. Pòlya is in awe of the symbols. As he is painstakingly trying to contemplate their meaning, he discovered a magical model (known to later generations as the Pòlya model). To make the teaching of his model more vivid and interesting, he created a game for his students to play.
At the start of the game, the bag contains
After the game has started, the following actions are strictly followed
at each step: Randomly draw a ball from the bag (there is equal
probability for drawing any ball). After Pòlya individually looks at the
color of the ball, he places the ball back into the bag, and then places
Let
Regarding the
where
Input Specification
The first line contains three positive integer
The second line contains
For the next
Output Specification
Determine the answer in fraction form (it is clear that this probability
is a rational number). Output a single line in the format:
numerator/denominator
. At the same time, output a reduced fraction
(where the numerator and denominator are relatively prime). For the
probability of 0/1
. For the probability of 1/1
.
Sample Input 1
2 3 1
1 1
1 1
2 2
3 1
Sample Output 1
1/12
Explanation of Sample 1
Initially, the amount of each of the two types of balls are
Before the second draw, the amounts of the two types of balls are
Before the third draw, the amounts of the two types of balls are
Therefore, the total probability for all three draws is
Sample Input 2
3 1 2
1 1 1
5 1
Sample Output 2
1/3
Problem translated to English by .
Comments