The manhattan distance between two points
and is given by .
In other words, manhattan distance is the minimum number of moves required to reach from if, in each move, you are allowed to travel one unit along the -axis or one unit along the -axis.
You are given an integer . Find four points with integer coordinates, such that:
- The absolute value of both and coordinates of all points is at most .
- The manhattan distance between any pair of points is . More formally, for all .
If such set of points do not exist, print -1
. If there are multiple solutions, you may print any.
Note: It is guaranteed that whenever there exists a solution, there exists one in which all points have coordinates with absolute values not more than .
Input Format
- The first line contains a single integer, - as per the problem statement.
Output Format
- If there is no solution, print in a single line the integer
-1
. - Otherwise print lines. The line, should contain two space separated integers, , the coordinates of the point , such that .
Constraints
Subtasks
Subtask #1 (100 points): original constraints
Sample Input 1
2
Sample Output 1
0 1
1 2
2 3
3 4
Explanation
The following sample output for this testcase is not correct, but is only provided to clarify the output format
The points in the solution are and . but . As , the solution is incorrect.
A correct solution will satisfy
A correct sample output is not provided so as to not reveal any hints about the solution.
Sample Input 2
1
Sample Output 2
-1
Explanation
You may verify that for , there are no set of points as per the problem statement. This output is correct.
ConversionConversion EmoticonEmoticon