Problems
Write a program that, given nnn integers, computes their greatest common divisor and their least common multiple.
Input
The first line contains
The next line contains
Each integer is between 2 and 10,000 inclusive. All inputs satisfy these constraints.
Output
Output the greatest common divisor and the least common multiple of the given integers, separated by a space.
The least common multiple will not exceed 2,000,000,000.
Example
3
2 8 10
2 40
Tag
Source
JUNGOL