1962 通分


Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 32M

Problem types
Allowed languages
C, C++, Java, Python

Description

笨小明,上课睡觉觉,甚至打呼噜,到了做题就不会了。终于有一天,他被数学老师点名啦!老师给他n和m,问他1/n+1/m等于几分之几啊?小明发呆了,老师看小明可怜,就直说只要通一下分哎,小明还是不会。旁边的你,立即一阵猛算,然后悄悄地告诉小明,总算解了小明的围。你是怎么算出来的呢?

Input

第一行一个整数T。接下来T对正整数n,m(0<n,m<=1e+9)。

Output

每对整数输出一行结果:最简分数抑或整数。格式见样本输出。

Sample

Input

4
1 2
2 3
100 99
2 2

Output

3/2
5/6
199/9900
1

Source: qn


Comments

There are no comments at the moment.