不知
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 1024 M,其他语言2048 M
Special Judge, 64bit IO Format: %lld

题目描述

Little Jellyfish had a dream.

She dreamed that there were two identical boxes in front of her, one containing a gem worth c gold coins and the other empty. If she chose the correct box, she would receive the gem; otherwise, she would receive nothing.

Little Jellyfish didn't know which box contained the gem. Suddenly, her friend May appeared before her.

"I know which box the gem is in, but I won't answer your question for free. You need to pay me 1 gold coin to ask. I will tell you the correct box with probability p, and with probability 1-p, I will tell you the wrong box."

Little Jellyfish hesitated but missed this opportunity after all. Now she misses May a lot and wants to know the maximum expected number of gold coins she can earn if she asks questions optimally.

The dream keeps replaying in Little Jellyfish's mind, but she still hasn't found the answer.

输入描述:

The first line contains a positive integer T indicating the number of test cases.

For each test case, there is a line with three non-negative integers c, a, b\. The value of p can be calculated as p = \frac{a}{b}\.

输出描述:

For each test case, output x/y\ where \frac{x}{y} represents the answer. Ensure that \gcd(x, y) = 1\ and y is a positive integer.
示例1

输入

复制
4
9 1 2
5 4 5
20 9 10
200 4 9

输出

复制
9/2
3/1
710/41
530455/4149

备注:

1 \le T \le 100, 1 \leq c \leq 1000, 1 \leq a \leq b \leq 10.

In the first example case, May's answer holds no value, so the optimal strategy is to randomly choose a box.

In the second example case, the optimal strategy involves asking May once and then choosing the box she indicates. The expected number of gold coins earned is 5 \times \frac{4}{5} - 1 = 3\. It can be proven that this is the best strategy, as asking more than once would cost at least 2 gold coins, thereby not exceeding an expected earning of 3 gold coins.