405374: GYM101917 G A+B+C

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

Description

G. A+B+Ctime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Everybody knows the typical A+B problem, this one is much harder, instead of A+B it's going to be A+B+C, but with fractions.

Input

An integer T (1<=T<=$$$10{^3}$$$), the number of test cases T lines follow, each with 3 fraction numbers, each in the form $$$\frac{n}{d}$$$ (1<=n,d<=$$$10{^6}$$$)

Output

One line per test case, a single simplified fraction in the format $$$\frac{num}{den}$$$

ExampleInput
2
1/2 1/3 1/4
3/2 1/2 2/2
Output
13/12
3/1

Source/Category

加入题单

算法标签: