TWOSQRS - Two squares or not two squares

题意翻译

给出多个正整数,判断每个数能否表示为两个整数的平方的和 输入格式: 第一行:一个正整数c,表示需要判断的数的个数(c<=100) 之后c行每行一个正整数n,表示需要判断的数(0<=n=<10^12) 输出格式: 对于每一个n,判断能否写成两个整数的平方的和的形式;如果能,输出“Yes”,如果不能,则输出“No”

题目描述

Given integer n decide if it is possible to represent it as a sum of two squares of integers.

输入输出格式

输入格式


First line of input contains one integer c <= 100 - number of test cases. Then c lines follow, each of them consisting of exactly one integer 0 <= n <= 10^12.

输出格式


For each test case output Yes if it is possible to represent given number as a sum of two squares and No if it is not possible.

输入输出样例

输入样例 #1

10
1
2
7
14
49
9
17
76
2888
27

输出样例 #1

Yes
Yes
No
No
Yes
Yes
Yes
No
Yes
No