#65Easy
GCD and LCM
Time: 1 s · Memory: 256 MB
- Working with numbers
Statement
You are given natural numbers and . Find their greatest common divisor (GCD) and least common multiple (LCM).
Input format
A single line with two integers and ().
Output format
A single line with two numbers: the GCD and the LCM.
Examples
Input
24 18
Output
6 72
Input
17 37
Output
1 629
Note
Euclid's algorithm: , . Then — divide first, then multiply.
