Codeforces Round 338 (Div. 2)
翻译中…
Ayrat is looking for the perfect code. He decided to start his search from an infinite field tiled by hexagons. For convenience the coordinate system is introduced, take a look at the picture to see how the coordinates of hexagon are defined:
翻译中…
Ayrat is searching through the field. He started at point $(0, 0)$ and is moving along the spiral (see second picture). Sometimes he forgets where he is now. Help Ayrat determine his location after $*n*$ moves.
翻译中…
Input
翻译中…
The only line of the input contains integer $*n*$ ($0 ≤ *n* ≤ 10^{18}$) — the number of Ayrat's moves.
翻译中…
Output
翻译中…
Print two integers $*x*$ and $*y*$ — current coordinates of Ayrat coordinates.
翻译中…
样例
Input #1
3
Output #1
-2 0
InputCopy
OutputCopy
Input #2
7
Output #2
3 2
InputCopy
OutputCopy
题目信息
标签
二分
模拟
数学
题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。