Sum of fractions#7363

Sum of fractions

1 секунда
128 мегабајтова
Врло лако

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.

Улаз

One line contains four positive integers a, b, c, d — the numerators and denominators of the fractions. All numbers do not exceed .

Излаз

Print the numerator and denominator of the resulting fraction, or an integer if the result is a whole number.

Примери

Пример 1

Loading
Loading

Пример 9

Loading
Loading