TRIISO - Playing with isosceles triangle

Naruto was always alone as a kid. He used to get bored a lot and always tried different things for fun. Once he got fascinated by isosceles triangles and developed a game. He will choose a integer value S to be length of the equal sides of the isosceles triangle. Now if it is possible that he can form any triangle which has a third side of even length as well a height of integral value with the third side as base then he becomes happy.

Given S determine if Naruto will be happy.

Input

First line contains T, the number of test cases, T <= 10000.

The next T lines each contain a integer value S < 1000000.

Output

For each of T test cases output YES if Naruto will be happy and NO otherwise

Example

Input:
2
5
8

Output:
YES
NO

Explanation:

In 1st case for S=5, the third side can be 6 and height can be 4.

In 2nd case for S=8, no such combination is possible.


Added by:Abhra
Date:2013-10-09
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64

hide comments
2013-11-30 12:41:07 Ouditchya Sinha
Finally AC!! Mathematically awesome, very nice problem, loved solving it. Thank You. :)
2013-11-26 20:02:15 Sachin Railhan
Please provide any test case for which my code fails.
Getting WA again and again.
I have tried many random cases.It's working fine.
Thanks in advance.
Submission ID - 10542867

Last edit: 2013-11-26 20:25:10
2013-10-31 09:56:55 Prashant Kumar
ID-10388327 , can you please see why my program is giving TLE
2013-10-19 18:05:03 Gourav Saha
i am applying fermat's theorem.getting wa can you see my submission id-10298312

reply: its wrong

Last edit: 2013-10-26 11:53:03
2013-10-18 13:25:44 anurag garg
what is the complexity for the algorithm my O(n) gives TLE....
i am finding for each test case...
Edit
took three months to remove TLE
thanks daft_wullie

Last edit: 2014-02-08 08:53:42
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.