Woburn Challenge 2002
The Head-Monkey is a brilliant tactician, and what's more, she is
brilliant at having her troops prepared for battle. This time the battle
is for all the proverbial marbles. The Head-Monkey addresses her legion
and says: "My fellow monkeys, this battle is for all the marbles!", to
which Tiny responds, "Umm, no offence, do we get marbles if we win,
Sir?!" After this issue is dealt with, the Head-Monkey decides it's time
for the monkeys to prepare themselves for battle. The Head-Monkey is
quite a pacifist, and firmly believes in brains before brawn. Confident
of the fact that no matter how difficult the final battle is, her monkeys
will end up victorious if their minds are sharp, she poses the following
problem: Given two fractions
Constraints
BONUS: For the truly nerdy monkeys, the Head-Monkey has agreed to
give a bonus (i.e., this problem will count as
Input Specification
The first line contains a single integer,
Each test case consists of a single line containing four integers
separated by a space, namely
Output Specification
For each test case, output the fraction that satisfies the above
criteria, in the format m/n
. Remember,
Sample Input
2
1 3 2 3
1 5 2 5
Sample Output
1/2
1/3
Comments