Description
Calculate the math expression.
Input Format
Enter one line for a fraction equation.
The equation contains only numbers, +
, -
, and /
. Where /
is the fraction line, the left side of the line is the numerator (分子) and the right side is the denominator (分母). If the first term of the input equation is positive, it will not have the prefix +
sign; if it is negative, it will have the prefix -
sign.
All integers appear as fractions like 2/1
.
Output format
Outputs one line, which is the final result of the calculation (expressed as an integer if it is an integer, otherwise as a simplest fraction) (需要约分).
Sample input
2/1+1/3-1/4
Sample output
25/12
Data ranges
The length of the input equation is within $100$, and the numerator and denominator are within $1000$.
The fractions entered are not necessarily the simplest fractions.