P8039 [COCI 2016/2017 #7] UZASTOPNI
Background
**The only differences between this problem and [P1147](https://www.luogu.com.cn/problem/P1147) are the range of the sum of consecutive natural numbers and the output format.**
Description
Find all consecutive segments of natural numbers with length $\geqslant 2$ whose sum is $N$.
Input Format
The input contains only one line with an integer $N$, which represents the sum of the consecutive natural number segment.
Output Format
Output several lines. Each line contains two integers, representing the first number and the last number of a valid consecutive natural number segment, **sorted in descending order by the first number**.
For the given input, it is guaranteed that there is at least one solution.
Explanation/Hint
**[Sample 1 Explanation]**
$10=1+2+3+4$. We can see that there is one and only one consecutive natural number segment whose sum is $10$ and satisfies the requirements.
**[Constraints]**
For all testdata, $3\leqslant N\leqslant 10^{10}$.
**[Source]**
This problem is from **_[COCI 2016-2017](https://hsin.hr/coci/archive/2016_2017/) [CONTEST 7](https://hsin.hr/coci/archive/2016_2017/contest7_tasks.pdf) T2 UZASTOPNI_**. With the original problem's data settings, the full score is $80$ points.
Translated and organized by [Eason_AC](https://www.luogu.com.cn/user/112917).
Translated by ChatGPT 5