CF615E.Hexagons
提高+/省选-
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
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.
阿亚拉特正在寻找完美的代码。他决定从一个由正六边形无限铺满的平面开始他的搜索。为方便起见,引入了坐标系,请参看下图以了解六边形坐标的定义方式:

阿亚拉特正在该平面上搜索。他从点 (0,0) 出发,并沿螺旋路径移动(见第二张图)。有时他会忘记自己当前所在的位置。请帮助阿亚拉特确定他在经过 n 次移动后所处的位置。
输入格式
The only line of the input contains integer n (0 ≤ n ≤ 1018) — the number of Ayrat's moves.
输入仅包含一个整数 n(0 ≤ n ≤ 1018)——表示 Ayrat 的移动次数。
输出格式
Print two integers x and y — current coordinates of Ayrat coordinates.
输出两个整数 x 和 y —— Ayrat 当前的坐标。
输入输出样例
输入#1
3
输出#1
-2 0
输入#2
7
输出#2
3 2
输入解题思路,AI测评打分。不知道怎么写?