EQU2 - Yet Another Equation
题意翻译
**题目大意:**
对于方程
$$x^2 - ny^2 = 1$$
$n$ 是一给定整数,求解其最小正整数解 $(x, y)$。
**输入格式:**
输入第一行一个正整数 $t \le 30$,表示数据组数。
接下来 $t$ 行每行一个整数 $2 \le n \le 1000$,保证对于给定的 $n$ 方程有解。
**输出格式:**
请你每行输出两个正整数 $x\ y$,即每个 $n$ 对应的最小解。
题目描述
Consider the equation
> _x_ $ ^{2} $ - _n__y_ $ ^{2} $ = 1
where _n_ is some integer.
Find the smallest strictly positive integer solutions (_x_, _y_) for a given _n_.
输入输出格式
输入格式
The number of test cases _t_ (around 30), followed by a list of _t_ values of _n_ (2 ≤ _n_ ≤ 1000). You can assume that the equation can be solved for all values of _n_ in the input set.
输出格式
For every test case, the values of _x_ and _y_ separated by a space character, on separate lines.
输入输出样例
输入样例 #1
3
2
6
61
输出样例 #1
3 2
5 2
1766319049 226153980