QOJ.ac

QOJ

Süre Sınırı: 2 s Bellek Sınırı: 1024 MB

#23626. Tổng nghịch đảo

İstatistikler

Cho một số nguyên $n > 1$ và phương trình:

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

Hãy tìm hai số nguyên dương phân biệt $a, b$ thỏa mãn phương trình trên và có tổng $a + b$ nhỏ nhất.

Dữ liệu vào

  • Dòng duy nhất của dữ liệu vào gồm một số nguyên $n$ ($1 < n \le 10^8$) — số ở vế trái của phương trình.

Dữ liệu ra

In ra lựa chọn tốt nhất cho $a$ và $b$ theo thứ tự tăng dần.

Ví dụ

Dữ liệu vào 1

4

Dữ liệu ra 1

6 12

Dữ liệu vào 2

107

Dữ liệu ra 2

108 11556

Dữ liệu vào 3

999999

Dữ liệu ra 3

1998000 2002000

Dữ liệu vào 4

1000000

Dữ liệu ra 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.