SP12413 PONY6 - Toward Infinity

Description

Story: Twilight Sparkle was working on some formulas when she came across a strange pattern. When she added 1/2 + 1/4 + 1/8 + ..., she saw that it kept getting closer and closer to 1. She was able to figure out that problem and a few more, but there are others that are too difficult. She needs your help.

Input Format

You will be given a number T on the first line. The following T lines will be of the form S k r where S is a String label with no spaces, and both k and r are as described above.

Output Format

Your output will contain T lines of the form S N / D where S is the label you were given in the input, N is the numerator of the answer, and D is the denominator. D may be 1. To be more precise, if the fraction is negative, then output the negative sign next to N.