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
Deepanshu:
20130711 15:27:22
my code is taking 0.0 sec to run on ideone compiler but the spoj judge is showing TLE 

Aasheesh Verma:
20130704 17:04:18
nice one... 

sacoder9114:
20130622 20:01:31
again and again TLE...


Jagatheesvaran Palanisamy:
20130405 14:43:59
Learnt a lot ...Use Prime factor Method..And think about how many primes u want to precompute.Finally think what will do if the prime exceeds the bound,, 

fawaz ibrahim:
20130329 19:14:33
oh my god ... <<<TLE>>> 

phoenix:
20130327 20:00:37
why does it say no to 2? isnt 2=1^2+1^2?


Ouditchya Sinha:
20130319 16:15:08
Good Question! Learnt a lot today... :) 

shashank:
20130314 05:47:28
time limit exceding ?


aqfaridi:
20130225 09:54:29
@Pawel Gawrychowski


The Mundane Programmer:
20130218 01:51:25
Mathematical one...... 
Added by:  gawry 
Date:  20040629 
Time limit:  2s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All 