P28449 [洛谷] Tweetuzki Loves Arithmetic Sequences
普及+
题目描述

Problem Description

Tweetuzki has a special fondness for arithmetic sequences, especially those with a common difference of $1$ and consisting entirely of positive integers.

Clearly, for every number $s$, there exists an arithmetic sequence with a common difference of $1$ and consisting entirely of positive integers whose sum is $s$. Tweetuzki wants to know the smallest possible first term of such a sequence.

Since Tweetuzki is particularly weak in mathematics, especially in factoring, he asks you to provide the result.

Input Format

The input consists of a single line containing an integer $s$ $(1 \le s \le 10^{12})$.

Output Format

Output two positive integers, representing the first and last terms of the arithmetic sequence, respectively. Ensure that the first term is the smallest possible.

Sample Input and Output

Sample Input #1

9

Sample Output #1

2 4

Sample Input #2

16

Sample Output #2

16 16

Sample Input #3

1000000007

Sample Output #3

500000003 500000004

Notes

Sample Explanation 1

$2 + 3 + 4 = 9$

Sample Explanation 2

$16 = 16$

Data Range

For $10\%$ of the test cases, $s \le 10^6$.
For $100\%$ of the test cases, $1 \le s \le 10^{12}$.

Hints

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 sequence with a common difference of $1$ and consisting entirely of positive integers.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
9
样例输出
2 4