405664: GYM102028 E Resistors in Parallel
Description
In this physics problem, what we are concerned about are only resistors. If you are poor at physics, do not worry, since solving this problem does not require you to have advanced abilities in physics.
Resistors are said to be connected together in parallel when both of their terminals are respectively connected to each terminal of the other resistors.
We have the following parallel resistor equation for k resistors with resistances R1, R2, ..., Rk in parallel and their combined resistance R:
Now you have n resistors, the i-th of which has a resistance of ri ohms with the equation
You also have n selections, the i-th of which is a set of resistors Si such that
Please find a selection in which the resistors form a parallel resistor with the minimum resistance and output the reduced fraction of its resistance.
InputThe input contains several test cases, and the first line contains a positive integer T indicating the number of test cases which is up to 100.
For each test case, the only one line contains an integer n, where 1 ≤ n ≤ 10100.
OutputFor each test case, output a line containing a reduced fraction of the form p/q indicating the minimum possible resistance, where p and q should be positive numbers that are coprime.
ExampleInput3Output
10
100
1000
1/2
5/12
35/96