Problem Description

Input has two integers p and q are provided (q != 0). Reduce the fraction p/q and output as p q (reduced). Keep denominator positive.

Input Format

One line: p q.

Output Format

One line: rp rq.

Sample Test Case

Input:
-6 9
Output:
-2 3

Constraints

q != 0, values fit in 64-bit.

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next