P5077 Tweetuzki Loves Arithmetic Progressions

Description

Tweetuzki especially likes arithmetic progressions. In particular, he likes arithmetic progressions with common difference $1$ and all terms being positive integers. Obviously, for every number $s$, we can find an arithmetic progression with common difference $1$ and all terms being positive integers such that the sum of its terms is $s$. Now, Tweetuzki wants to know: among all such arithmetic progressions, what is the smallest possible first term. Since Tweetuzki is very bad at math, especially at factoring, please tell him the answer.

Input Format

The input contains only one line with an integer $s$ $(1 \le s \le 10^{12})$.

Output Format

Output two positive integers, representing the first term and the last term of the arithmetic progression. Note that you must output the smallest possible first term.

Explanation/Hint

**Sample Explanation 1** $2 + 3 + 4 = 9$ **Sample Explanation 2** $16 = 16$ ## Constraints For $10\%$ of the testdata, $s \le 10^6$. For $100\%$ of the testdata, $1 \le s \le 10^{12}$. If there is a sequence $a$ where each term $a_i$ satisfies $a_i \in \mathbb{N_{+}}$ and $a_i - a_{i - 1} = a_{i + 1} - a_i = 1$, then this sequence is called an arithmetic progression with common difference $1$ and all terms being positive integers. Translated by ChatGPT 5