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

建议使用的浏览器:

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

3542:ZaakDov is doing his math problem!

题目描述
Given an odd prime p.
You are to tell whether p can be written into form a^2+b^2 (0<a<=b),
and if p can be done, you are to determine a pair of a,b.
输入解释
There will be up to 2*10^5 test cases.
An odd prime p (3<=p<2*10^9) in each line.
End with EOF.
输出解释
For each number p,
if p can be written into form a^2+b^2 (0<=b),
output one line that contains "Legal a b",
and if not just output one line that contains "Illegal".
For a certain p that can be written into the form described above, any pair of a,b (0<=b) will do.
输入样例
3
5
7
11
13
17
19
23
29
输出样例
Illegal
Legal 1 2
Illegal
Illegal
Legal 2 3
Legal 1 4
Illegal
Illegal
Legal 2 5
来自杭电HDUOJ的附加信息
Recommend zhengfeng

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-3542

最后修改于 2020-10-25T23:04:35+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
8000/4000MS(Java/Others) 131072/65536K(Java/Others)