zoukankan      html  css  js  c++  java
  • 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
  • 相关阅读:
    重排列
    最多分成多少块
    后面第一个大于
    走格子
    硬币游戏
    还是01串
    戴德兰
    个人所得税
    最长高地
    执行Commit时Oracle做哪些工作
  • 原文地址:https://www.cnblogs.com/albert67/p/10357252.html
Copyright © 2011-2022 走看看