Sum of fractions
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Find the sum of two proper fractions and . Present the result as an irreducible fraction. If the result is an integer, then print only this integer.
Input
One line contains four positive integers — the numerators and denominators of the fractions. All numbers do not exceed .
Output
Print the numerator and denominator of the resulting fraction, or an integer if the result is a whole number.
Examples
Input #1
Answer #1
Input #9
Answer #9
Submissions 5K
Acceptance rate 41%