ZOJ Problem Set - 2506
Once upon a time, in a small Kingdom of Multiland the wise and good King Shuvarr the Reformer decided to repair the economy of his poor country. In order to save up some lead, which is very important to Multiland's industry he commanded to reduce usage of pencils. Because citizens of Multiland are very accurate they used very precised fractions. So the wise king limited in his decree the maximum value of denominators. Help Multilanders in this strange situation !
Your program should
In the first line of input there is C (1<=C<=100000) which is the number of the test cases. The next 2*C lines contain :
Your program has to write C lines, each of them consisting of the numerator, slash and denominator of the simplified fraction.
INPUT 3 100/200 10 3/10 5 9/11 8 OUTPUT 1/2 1/3 5/6
Problemsetter: Lukasz "Luke" Wolochowski (firstname.lastname@example.org)