HUST Monthly 2010.06.13

From: 2010-06-13 12:00:00 To: 2010-06-13 17:00:00 Now: 2017-09-20 01:00:47 Status: Public

D - marshmallow

Time Limit: 1s Memory Limit: 128MB

Submissions: 138 Solved: 67
Description
Jack’s girlfriend loves marshmallow very much, so he buys her two bags of marshmallow on the Children’s Day. One of them is made up of red one’s, whose number is about n, and the other is blue with number of m. Suddenly Jack comes up with an idea that he can play a game with his girlfriend and test her IQ as well. So he takes some marshmallow out from the red one’s, together from the blue one’s, and puts them on the table. Now it begins with his girlfriend, she picks up the marshmallow on the table and eats them, then it’s Jack’s turn, after Jack, his girlfriend chooses, then Jack…… it goes on like this, but they have to follow some disciplines. Every time, he or his girlfriend can take away 1.any number of red one’s 2.any number of blue one’s 3.a red one, together with a blue one, is a must and he or she can be the winner if he or she takes away the last one. Jack considers that he is the second to none smartest guy in the world, what surprises him is that his girlfriend is also very smart, which makes Jack feel embarrassed…… Assuming that there are red marshmallow and blue marshmallow on the table, whose numbers are i(1 <= i< =n) and j(1 <= j <= m) , and such situation’s probability is 1/(n * m). Jack wants to know how much probability he has to win the game.
Input
Group data, and each group is made up of two positive integer n and m (1 <= n, m <= 10000)
Output
Output Jack’s probability of winning the game with irreducible fraction, if he has no chance to win, please output 0/1
Sample Input
1 1
2 3
3 3
4 4
Sample Output
0/1
1/3
1/3
3/16
Hint
Source
Xuehui SONG