当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2427:Smith's Problem

Special Judge 特殊评判
题目描述
Computer has greatly released scientists from heavy calculation. Before computer is invented, calculation must be done by hand, which is boring and easy to make mistake. But now, with the help of computer much calculation can be finished within a second.

But one day Professor Smith met a strange problem. He had tried to find the positive solutions of the equation with the following form:
X ^ 2 – N * Y ^ 2 = 1,

in which N is a positive integer. But for many values of N, his poor computer seems cannot find an answer!

"That's strange!" said Professor Smith "There must be something wrong with my program!" And you, the assistant of Professor Smith, are assigned the work to solve the problem.
输入解释
The input will contain several test cases; each contains a positive integer N (1 <= N <= 10 ^ 8) in a single line.
输出解释
For each test case, in a line output two positive integers X and Y that satisfy the equation and are smaller than 10 ^ 1000. If there is no such solution, output "No solution!"
输入样例
52
256
991
输出样例
649 90
No solution!
379516400906811930638014896080 12055735790331359447442538767

该题目是Virtual Judge题目,来自 北京大学POJ

题目来源 PKU Monthly,static

源链接: POJ-2427

最后修改于 2020-10-29T06:32:15+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
5000 65536