Problem D: 【GESP2】平方之和
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:85
Solved:28
Description
小杨有 n个正整数 a1 ,a2 ,... ,an,他想知道对于所有的 i ( 1 ≤ i ≤ n ),是否存在两个正整数 x 和 y 满足 x*x + y*y = ai。
例如: 对于正整数 5 ,存在 2*2 + 1*1 = 5 ,因此答案为 Yes。
Input
-
输入格式第一行包含个正整数 n,代表正整数数量。之后 n行 ,每行包含一个正整数,代表 ai。
Output
- 输出格式对于每个正整数 ai ,如果存在两个正整数 x 和 y 满足 x*x + y*y =ai ,输出 Yes,否则输出 No。
Sample Input Copy
2
5
4
Sample Output Copy
Yes
No
HINT
对于全部数据,保证有 1 ≤ n ≤ 10, 1 ≤ ai ≤ 10^6。