LogiQuest

21. GCD and LCM

EasyMathNumber Theory

Print the greatest common divisor and least common multiple of two positive integers.

Input format

Two integers a b.

Output format

gcd lcm

Example 1

Input

12 18

Output

6 36

Example 2

Input

7 13

Output

1 91

Constraints

1 ≤ a, b ≤ 10⁹

Read input from standard input and print the answer to standard output. Your code is judged against 5 test cases, most of them hidden.

Loading the MyLoginn IDE…