QOJ.ac

QOJ

시간 제한: 2 s 메모리 제한: 1024 MB

#23626. Inverssumma

통계

Givet ett heltal $n > 1$ och ekvationen:

$$\frac{1}{n} = \frac{1}{a} + \frac{1}{b}$$

Hitta två olika positiva heltal $a, b$ som uppfyller ekvationen ovan och som har en minimal summa $a + b$.

Indata

  • Den enda raden med indata består av ett heltal $n$ ($1 < n \le 10^8$) — talet i ekvationens vänsterled.

Utdata

Skriv ut de bästa valen för $a$ och $b$ i stigande ordning.

Exempel

Indata 1

4

Utdata 1

6 12

Indata 2

107

Utdata 2

108 11556

Indata 3

999999

Utdata 3

1998000 2002000

Indata 4

1000000

Utdata 4

1800000 2250000

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.