2571. GCD and LCM

Naive基本数据类型基本算法

时间限制:2000 ms

内存限制:256 MiB

题面

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

输入格式

The first line of input gives the number of cases, NN (1N100)(1 \leq N \leq 100). NN 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.

样例

输入

2
8 6
5000 3000

输出

2 24
1000 15000