1372 - marshmallow

Time Limit : 1 Second

Memory Limit : 128 MB

Submission: 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
© 2015 HUST ACMICPC TEAM. All Right Reserved.