시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 1293 1037 965 81.572%

문제

두 정수 a와 b 최소공배수는 두 수의 공통된 배수 중 가장 작은 수이고, 최대공약수는 두 수의 공통된 약수중 가장 큰 수이다.

a와 b가 주어졌을 때, 최소공배수와 최대공약수를 구하는 프로그램을 작성하시오.

입력

첫째 줄에 테스트 케이스의 개수 T(1<=T<=1,000)가 주어진다. 각 테스트 케이스는 두 정수 a와 b로 이루어져 있고, 공백으로 구분되어 있다. (1 <= a,b <= 1,000)

출력

각 테스트 케이스에 대해 최소공배수와 최대공약수를 차례대로 출력한다.

예제 입력 1

3
5 10
7 23
42 56

예제 출력 1

10 5
161 1
168 14
W3sicHJvYmxlbV9pZCI6IjI3MDIiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWNkMDg2IFx1YzIxOFx1ZDU1OSIsImRlc2NyaXB0aW9uIjoiPHA+XHJcblx0XHViNDUwIFx1YzgxNVx1YzIxOCBhXHVjNjQwIGIgXHVjZDVjXHVjMThjXHVhY2Y1XHViYzMwXHVjMjE4XHViMjk0IFx1YjQ1MCBcdWMyMThcdWM3NTggXHVhY2Y1XHVkMWI1XHViNDFjIFx1YmMzMFx1YzIxOCBcdWM5MTEgXHVhYzAwXHVjN2E1IFx1Yzc5MVx1Yzc0MCBcdWMyMThcdWM3NzRcdWFjZTAsIFx1Y2Q1Y1x1YjMwMFx1YWNmNVx1YzU3ZFx1YzIxOFx1YjI5NCBcdWI0NTAgXHVjMjE4XHVjNzU4IFx1YWNmNVx1ZDFiNVx1YjQxYyBcdWM1N2RcdWMyMThcdWM5MTEgXHVhYzAwXHVjN2E1IFx1ZDA3MCBcdWMyMThcdWM3NzRcdWIyZTQuPFwvcD5cclxuXHJcbjxwPlxyXG5cdGFcdWM2NDAgYlx1YWMwMCBcdWM4ZmNcdWM1YjRcdWM4NGNcdWM3NDQgXHViNTRjLCBcdWNkNWNcdWMxOGNcdWFjZjVcdWJjMzBcd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