QOJ.ac

QOJ

時間限制: 2 s 記憶體限制: 1024 MB

#23626. Käänteislukujen summa

统计

Annettuna on kokonaisluku $n > 1$ ja yhtälö:

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

Etsi kaksi eri positiivista kokonaislukua $a, b$, jotka toteuttavat yllä olevan yhtälön ja joiden summa $a + b$ on mahdollisimman pieni.

Syöte

  • Syötteen ainoa rivi koostuu yhdestä kokonaisluvusta $n$ ($1 < n \le 10^8$) — yhtälön vasemmalla puolella olevasta luvusta.

Tuloste

Tulosta parhaat valinnat luvuille $a$ ja $b$ nousevassa järjestyksessä.

Esimerkit

Syöte 1

4

Tuloste 1

6 12

Syöte 2

107

Tuloste 2

108 11556

Syöte 3

999999

Tuloste 3

1998000 2002000

Syöte 4

1000000

Tuloste 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.