QOJ.ac

QOJ

حد الوقت: 2 s حد الذاكرة: 1024 MB

#23626. סכום הופכיים

الإحصائيات

נתון מספר שלם $n > 1$, והמשוואה:

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

מצאו שני מספרים שלמים חיוביים שונים $a, b$ המקיימים שניהם את המשוואה שלעיל, ושסכומם $a + b$ מינימלי.

קלט

  • שורת הקלט היחידה מכילה מספר שלם אחד $n$ ($1 < n \le 10^8$) — המספר עבור האגף השמאלי של המשוואה.

פלט

הדפיסו את הבחירות הטובות ביותר עבור $a$ ו-$b$ בסדר עולה.

דוגמאות

קלט 1

4

פלט 1

6 12

קלט 2

107

פלט 2

108 11556

קלט 3

999999

פלט 3

1998000 2002000

קלט 4

1000000

פלט 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.