Problem H. GCD & LCM Inverse

时间限制 2000 ms   内存限制 64 MB

Given two positive integers a and b, we can easily calculate the greatest common divisor (GCD) and the least common multiple (LCM) of a and b. But what about the inverse? That is: given GCD and LCM, finding a and b.

输入数据

The input contains multiple test cases, each of which contains two positive integers, the GCD and the LCM. You can assume that these two numbers are both less than 2^63.

输出数据

For each test case, output a and b in ascending order. If there are multiple solutions, output the pair with smallest a + b.

样例输入

复制
3 60

样例输出

复制
12 15

提交

请先 登录

© 2025 FAQs Contact About