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
numerix:
20141007 16:15:13
My former AC code now results in INTERNAL ERROR. Can that be checked, please? 

S:
20140926 10:11:29
leant a lot from this :D


vikrant:
20140921 12:44:56
can u please check my submission with Id:12422611


mohan kumar:
20140622 13:58:22
i am getting time limit exceedence,any one


Rahul Ranjan:
20140604 08:05:41
http://ideone.com/Wm73oi


`Ak:
20140527 16:28:13
finally got AC :)


shashi roshan:
20140527 12:37:11
Last edit: 20141024 08:12:40 

suryasis:
20140311 09:06:53
c*sqrt(n) tle wtf 

Unknown:
20140206 06:47:40
interesting one..!!! 

Daga:
20140114 07:50:55
Not accepting in sqrt(n) ... Tle Last edit: 20140114 07:51:23 
Added by:  gawry 
Date:  20040629 
Time limit:  2s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All 