#T348. 分数求和
分数求和
Description
Input fractions and sum them up, then express the result in its simplest form. The simplest form means that the greatest common divisor (GCD) of the numerator and denominator is ; if the denominator of the final result is , represent it directly as an integer.
Neither the numerator nor the denominator is or negative.
Input Format
The first line is an integer , indicating the number of fractions, where ; The next lines each contain a fraction in the form "", without spaces, where and do not exceed .
Output Format
The output consists of only one line, which is the final result in its simplest form. If the result is a fraction, represent it in the form "".
2
1/2
1/3
5/6