Problem Description

Read two fractions a/b and c/d. Create Fraction class that reduces and supports add. Output result as p q reduced.

Input Format

One line: a b c d.

Output Format

One line: p q.

Sample Test Case

Input:
1 6 1 3
Output:
1 2

Constraints

b,d != 0.

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next