TWOSQRS  Two squares or not two squares
Given integer n decide if it is possible to represent it as a sum of two squares of integers.
Input
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.
Output
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.
Example
Input: 10 1 2 7 14 49 9 17 76 2888 27 Output: Yes Yes No No Yes Yes Yes No Yes No
hide comments
shravinson:
20150715 06:51:23
i m getting WA


scyth3r:
20150701 22:10:30
Please remember to use unsigned long long...got 9 WAs :< 

jas.py:
20150626 09:53:12
i must say time limit of this question is too high which lets you solve it by brute force(which even i did 1st ;) ).


geekyadity:
20150618 16:49:02
Basic Maths. However I have a slight problem. When I checked earlier that :


:.Mohib.::
20150615 10:23:33
Nice que!! Learned a lot...!! 

Amitayush Thakur:
20150528 22:41:39
Was doing a very silly error costed me 3 WAs . Be careful with overflow errors and use long long. 

kartikay singh:
20150528 07:05:54
Easy ,AC in 1 go B) 

[Mayank Pratap]:
20150526 18:00:09
Enjoyed the problem .... AC 0.03 :) 

goyal:
20150504 11:19:03
nice one simple math is required AC in first go 

Sue:
20150308 05:40:18
10 is the number of test case :( Last edit: 20150308 06:09:28 
Added by:  gawry 
Date:  20040629 
Time limit:  2s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All 