GCD and LCM - MarisaOJ: Marisa Online Judge

GCD and LCM

Time limit: 1000 ms
Memory limit: 256 MB
You are given 2 integers $a, b$. Calculate they Greatest Common Divisor (GCD) and Lowest Common Multiple (LCM). - The GCD of two integers, which are not all zero, is the largest positive integer that divides each of the integers. - The LCM of two numbers is the smallest number that is a multiple of both of them. ### Input - The first line contains 2 integers $a, b$. ### Output - GCD and LCM of $a, b$. ### Constraints - $1 \le a, b \le 10^9$. ### Example Input: ``` 4 6 ``` Output: ``` 2 12 ```