Pro.ID21605 TitleNumber Title链接http://10.20.2.8/oj/exercise/problem?problem_id=21605 AC22 Submit102 Ratio21.57% 时间&空间限制描述Given the greatest common divisor (GCD) and the least common multiple (LCM) of two integers a and b ( a ≤ b ), please find the minimum of b-a. 输入Input may consist of several test data sets. For each data set, it can be format as below: There is just one line containing two integers, the GCD and the LCM, both are between [1, 109]. Input is ended by GCD = LCM = 0. 输出Description Given the greatest common divisor (GCD) and the least common multiple (LCM) of two integers a and b ( a ≤ b ), please find the minimum of b-a. Input Input may consist of several test data sets. For each data set, it can be format as below: There is just one line containing two integers, the GCD and the LCM, both are between [1, 109]. Input is ended by GCD = LCM = 0. Output For each data set, output one integer representing the minimum difference of a and b can be found, and then output a, then b, separated with only one space. If more than one pair of a and b can be found, output the one which has minimum a. Sample Input 6 36 Sample Output 6 12 18 Source 样例输入6 36 样例输出6 12 18 作者 |