CF1285C.Fadi and LCM

普及/提高-

通过率:0%

时间限制:1.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Today, Osama gave Fadi an integer XX, and Fadi was wondering about the minimum possible value of max(a,b)max(a, b) such that LCM(a,b)LCM(a, b) equals XX. Both aa and bb should be positive integers.

LCM(a,b)LCM(a, b) is the smallest positive integer that is divisible by both aa and bb. For example, LCM(6,8)=24LCM(6, 8) = 24, LCM(4,12)=12LCM(4, 12) = 12, LCM(2,3)=6LCM(2, 3) = 6.

Of course, Fadi immediately knew the answer. Can you be just like Fadi and find any such pair?

今天,Osama 给了 Fadi 一个整数 XX,Fadi 开始思考:满足 LCM(a,b)=XLCM(a, b) = X 的正整数对 (a,b)(a, b) 中,max(a,b)max(a, b) 的最小可能值是多少?
其中,aa 和 bb 均为正整数。

LCM(a,b)LCM(a, b) 表示能同时被 aa 和 bb 整除的最小正整数。例如,LCM(6,8)=24LCM(6, 8) = 24,LCM(4,12)=12LCM(4, 12) = 12,LCM(2,3)=6LCM(2, 3) = 6。

当然,Fadi 立刻就得出了答案。你能否像 Fadi 一样,找出任意这样的一对 (a,b)(a, b)?

输入格式

The first and only line contains an integer XX (1≤X≤10121 \le X \le 10^{12}).

第一行且唯一一行包含一个整数 XX(1≤X≤10121 \le X \le 10^{12})。

输出格式

Print two positive integers, aa and bb, such that the value of max(a,b)max(a, b) is minimum possible and LCM(a,b)LCM(a, b) equals XX. If there are several possible such pairs, you can print any.

输出两个正整数 aa 和 bb,使得 max(a,b)max(a, b) 的值尽可能小,且 LCM(a,b)=XLCM(a, b) = X。如果存在多组满足条件的数对,输出任意一组即可。

输入输出样例

  • 输入#1

    2

    输出#1

    1 2
  • 输入#2

    6

    输出#2

    2 3
  • 输入#3

    4

    输出#3

    1 4
  • 输入#4

    1

    输出#4

    1 1

输入解题思路,AI测评打分。不知道怎么写?

首页