Competitions
Full Search
Two numbers and the four actions
Over two positive integers were executed the following four steps:
- they were added;
- the less number was subtracted from the larger;
- they were multiplied;
- the bigger number was divided by the smaller.
The results were added - and the number n was obtained. You must find all such pairs of numbers.
Input
One positive integer n (1 ≤ n ≤ 1012
).
Output
Print on a separate lines the pairs of integers x ≤ y, satisfying the problem. Couples must be ordered by increasing x. If there is no pair of numbers satisfying the condition, display "**NO SOLUTION**" (without the quotes).
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