Simplify Fraction

Computer Mathematics Medium 3 views
Back to Questions

Problem Description

Given a/b, reduce it to lowest terms and keep sign in numerator.

Input Format

Two integers a b (b!=0).

Output Format

Two integers p q.

Sample Test Case

Input:
-10 30
Output:
-1 3

Constraints

b!=0

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next