佩尔方程的解
Description
求關(guān)于x y的二次不定方程的解 x2-ny2=1
Input
多組輸入數(shù)據(jù),先輸入組數(shù)T 然后輸入正整數(shù)n(n<=100)
Output
對于每組數(shù)據(jù)輸出一行,求y<=10000的最小正整數(shù)解 ,輸出y的值,如果在此范圍內(nèi)沒有解則輸出No
Sample Input
1
73
Sample Output
No
總結(jié)
Description
求關(guān)于x y的二次不定方程的解 x2-ny2=1
Input
多組輸入數(shù)據(jù),先輸入組數(shù)T 然后輸入正整數(shù)n(n<=100)
Output
對于每組數(shù)據(jù)輸出一行,求y<=10000的最小正整數(shù)解 ,輸出y的值,如果在此范圍內(nèi)沒有解則輸出No
Sample Input
1
73
Sample Output
No