问题 I: The minimum square sum

问题 I: The minimum square sum

时间限制: 1 Sec  内存限制: 128 MB
提交: 109  解决: 24
[状态] [讨论版] [提交] [命题人:]
题目描述
  Given a prime p (p<10^8),you are to find min{x^2+y^2},where x and y belongs to positive integer, so that x^2+y^2=0 (mod p).

输入
  Every line is a p. No more than 10001 test cases.
输出
  The minimum square sum as described above.

样例输入 Copy
2
3
5
样例输出 Copy
2
18
5