POJ2429--GCD & LCM Inverse (UNSOLVED)
Posted albert67
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了POJ2429--GCD & LCM Inverse (UNSOLVED)相关的知识,希望对你有一定的参考价值。
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.
Input
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.
Output
For each test case, output a and b in ascending order. If there are multiple solutions, output the pair with smallest a + b.
Sample Input
3 60
Sample Output
12 15
以上是关于POJ2429--GCD & LCM Inverse (UNSOLVED)的主要内容,如果未能解决你的问题,请参考以下文章
POJ 2429 GCD & LCM Inverse(Pollard_Rho+dfs)
poj 2429GCD & LCM Inverse (Miller-Rabin素数测试和Pollard_Rho_因数分解)
GCD & LCM Inverse POJ 2429(Pollard Rho质因数分解)