QOJ.ac

QOJ

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

#23626. Somma di reciproci

统计

Dato un intero $n > 1$ e l'equazione:

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

Trova due interi positivi distinti $a, b$ che soddisfino l'equazione precedente e abbiano somma $a + b$ minima.

Input

  • L'unica riga di input consiste in un intero $n$ ($1 < n \le 10^8$) — il numero al membro sinistro dell'equazione.

Output

Stampa le scelte migliori per $a$ e $b$ in ordine crescente.

Esempi

Input 1

4

Output 1

6 12

Input 2

107

Output 2

108 11556

Input 3

999999

Output 3

1998000 2002000

Input 4

1000000

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