logo AlgoBeat OnlineJudge
登录 注册

#217573. [ICPC 2018 Jiaozuo R] Resistors in Parallel

内存限制:512 MiB 时间限制:2000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

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.

:::align{center} :::

We have the following parallel resistor equation for resistors with resistances in parallel and their combined resistance :

Now you have resistors, the -th of which has a resistance of ohms with the equation

You also have selections, the -th of which is a set of resistors 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.

输入格式

The input contains several test cases, and the first line contains a positive integer indicating the number of test cases which is up to .

For each test case, the only one line contains an integer , where .

输出格式

For 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.

样例

样例输入 1

3
10
100
1000

样例输出 1

1/2
5/12
35/96