Perfect squares
In order to search for patterns, it is sometimes useful to generate a long sequence according to certain rules. It is known, for example, that the sequence 0, 0 + 1, 0 + 1 + 3, 0 + 1 + 3 + 5, ... , 0 + 1 + 3 + .. + (2n - 1), ... , composed of the sums of several first odd positive integers, consists of squares of integers: 0, 1, 4, 9, ..., n^2
, ... .
We generalize this sequence as follows: instead of the initial value, we will use not a zero, but a number k. We get the sequence: k, k + 1, k + 1 + 3, k + 1 + 3 + 5, ... , k + 1 + 3 + ... + (2n - 1), ... . In contrast to the case of k = 0, not only perfect squares can occur in this sequence. It is necessary to find the minimum non-negative integer number whose square is found in this sequence.
Write a program that, by the given integer k, determines which square of a minimal non-negative integer is found in the described sequence, or finds out that it does not contain complete squares at all.
Input
One integer k (-10^12
≤ k ≤ 10^12
) - the starting number in the sequence.
Output
Print the minimum nonnegative integer, which square is found in the described sequence. If the sequence does not contain squares of integers, print "none".
Explanataion
In the first example, each number in the sequence is a perfect square. The minimum of them is 0, 0^2
= 0.
In the second example, the sequence starts like this: -5, -4, -1, 4, 11, 20, ... . The minimum non-negative integer whose square is found in the sequence is 2, 2^2
= 4.
In the third example, the sequence starts like this: 2, 3, 6, 11, 18, ... . It does not have perfect squares.