Fractions: addition and subtraction
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Two fractions are given. Find their sum or difference.
Input
Each line contains an example of addition or subtraction of fractions. The numerator and denominator of each fraction is a positive integer, not greater than .
Output
For each input example, print in a separate line the answer in the form of an irreducible fraction. If the answer is negative, a minus sign in front of the fraction should be printed.
Examples
Input #1
Answer #1
Submissions 3K
Acceptance rate 31%