Spiral
Easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
The plane is divided into equal squares, which are filled with numbers from 0 to infinity in the form of a spiral in a clockwise direction:
Given a positive integer N. Required to find two neighbors on the side or corner of the cell, the number of which sum to N.
Input
The first line contains one integer N (1 <= N <= 1000).
Output
Bring two numbers through the gap is minimal neighbors in ascending order, and giving a total N.
Examples
Input #1
Answer #1
Submissions 1K
Acceptance rate 24%