eolymp
bolt
Try our new interface for solving problems
Problems

Two numbers and the four actions

Two numbers and the four actions

Over two positive integers were executed the following four steps: \begin{enumerate} \item they were added; \item the less number was subtracted from the larger; \item they were multiplied; \item the bigger number was divided by the smaller. \end{enumerate} The results were added --- and the number $n$ was obtained. Find all such pairs of numbers. \InputFile One positive integer $n~(1 \le n \le 10^{12})$. \OutputFile Print on a separate lines the pairs of integers $(x, y),x \le y$, satisfying the problem. Couples must be ordered by increasing $x$. If there is no pair of numbers satisfying the condition, print "\textbf{NO SOLUTION}".
Time limit 1 second
Memory limit 128 MiB
Input example #1
4
Output example #1
1 1
Input example #2
1
Output example #2
NO SOLUTION
Input example #3
243
Output example #3
2 54
8 24