Smith's Problem

TimeLimit:5000MS  MemoryLimit:65536K
64-bit integer IO format:%lld
Special Judge
未提交 | 登录后收藏
Problem Description
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.
Input
The input will contain several test cases; each contains a positive integer N (1 <= N <= 10 ^ 8) in a single line.
Output
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!"
SampleInput
52
256
991
SampleOutput
649 90
No solution!
379516400906811930638014896080 12055735790331359447442538767
Submit
题目统计信息详细
总AC数0
通过人数0
尝试人数0
总提交量0
AC率0.00%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签
出处

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: