2667. The K-th integer Pair

单点时限: 3.0 sec

内存限制: 256 MB

Sort the positive integer pair n and m which meets with (n2-mn-m2)2=1(n>=m) by the ascending order of n.

Now giving the k, can you tell me the k-th integer pair m and n?

输入格式

Each test case contains a single integer k(1<=k<=10^9). The input is terminated by a set starting with k = 0. This set should not be processed.

输出格式

For each test case, output on a line the value of m and n after mod 2009. Two integer separated by a space.

样例

Input
4
20
0
Output
3 5
738 901

11 人解决,16 人已尝试。

18 份提交通过,共有 63 份提交。

6.0 EMB 奖励。

创建: 15 年前.

修改: 6 年,11 月前.

最后提交: 3 年,8 月前.

来源: N/A

题目标签