LearnPy Hub
← Arena
IntermediateRating 1200

Add the Fractions

Add all the fractions and print the result in lowest terms as p/q (q > 0; write a whole number as p/1).

Input

n; then n fractions like 3/4 or -1/6, separated by spaces.

Output

One fraction.

Sample 1

Input
2
1/2 1/3
Output
5/6

Sample 2

Input
3
1/3 1/3 1/3
Output
1/1
solution.py
Output appears here
Add the Fractions · Python Arena problem · LearnPy Hub