Problem list
Log in
#coci00444 · COCI 2016/2017 Contest 7

Uzastopni

Gold IV 1.0 s 64 MB

1 $s / 64$ $MB / 80$ points

Output all the ways in which a given positive integer ​$N$ can be obtained as the sum of

several (two or more) consecutive positive integers. 1

Input

The first line of input contains the positive integer ​$N$ ​ (3 ≤ ​$N$ ​ ≤ 10​^{10}^{​}).

Output

For each sum of consecutive positive integers that is equal to ​$N$ ​ , in one line output the first

and the last addend. The order of lines in the output is not important. In each test case, at

least one corresponding sum will exist.

Example 1

Input
10

27
Output
output
1 4

13 14
8 10
2 7

Clarification of the first test case: ​10 = 1 + 2 + 3 + 4. 1The author apologizes if reading the task took too long, and promises that, in the future, he will try to be more concise, i.e., that he will try to explain the task using as less words and apologies in the footnotes as possible.

Source
COCI 2016/2017 Contest 7
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code