2571. GCD and LCM

单点时限: 2.0 sec

内存限制: 256 MB

Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given $a$ and $b$ $(0 < a, b \leq 44000)$.

输入格式

The first line of input gives the number of cases, $N$ $(1 \leq N \leq 100)$. $N$ test cases follow.

Each test case contains two interger a and b separated by a single space in a line.

输出格式

For each test case, print GCD and LCM separated by a single space in a line.

样例

Input
2
8 6
5000 3000
Output
2 24
1000 15000

1583 人解决,1828 人已尝试。

1992 份提交通过,共有 4034 份提交。

0.7 EMB 奖励。

创建: 11 年,4 月前.

修改: 2 年,10 月前.

最后提交: 1 周,5 天前.

来源: 2009 华东师范大学 研究生复试

题目标签