410193: GYM103973 C Roll the Circle

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

C. Roll the Circletime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Walk Alone has two circles. The two circles are externally tangent, and are of radius $$$a$$$ and $$$b$$$ respectively. He keeps the first circle of radius $$$a$$$ stationary, and rotates the second one around the first one, keeping the point of contact without slipping. He wants to know how many times will the second circle revolve after rolling it exactly one trip back to its starting point.

Input

The input consists of multiple test cases.

The first line contains an integer $$$T\ (1 \leq T\leq 10^5)$$$, the number of test cases.

For each test case, the first and the only line contains two integers $$$a$$$ and $$$b\ (1 \leq a, b \leq 10^{18})$$$, denoting the radius of two circles.

Output

For each test case output the answer in a line. The answer should be expressed as a minimal fraction $$$p/q$$$ where $$$\gcd(p,q)=1$$$.

ExampleInput
2
2 1
4 6
Output
3/1
5/3

加入题单

算法标签: