Олимпиадный тренинг

Задача 38465. Table


Задача

Темы:
An infinite table, the rows and columns of which are numbered with integers starting from & nbsp; 1 from top to bottom and from left to right, is filled with integers 1, 2, 3, etc. Numbers are written in
neighboring cells along the borders of squares of increasing size (see figure).


Input data format
The program receives as input one integer n, 1 ≤ n≤ 1018
Output data format
The program should output two integers: the row number and the column number, which contain the number n in this table. The record of output numbers must contain only numbers, output
real numbers in the answer is considered incorrect.
Examples
# Input Output
1 15 4 2