Submit | All submissions | Best solutions | Back to list |
HUSGAME - Huseyn and his game |
Once our hero Huseyn invited Ziya the ProGrammer ProGamer to play his new game with him. Ziya has a great prestige in the gamers area, so he must win the game or ignore the invitation to save his reputation. The rules of the game are not difficult:
- Initially, there are N stones on the table. Huseyn will start the game and they will play alternatively.
- Each turn consisting of replacing the number of stones n on the table with n-1 or [(n+1)/2]. Here [] is floor function.
- The player who makes 1 stone remain wins.
As Ziya is busy with playing games (you know, he can't pause online games :P) you need to make an honest decision for him.
Input
There will be multiple test cases. The first line of the input consisting of the number of the test cases - T (1 ≤ T ≤ 10000). For each test case, there will be only one line donating single integer - N (1 ≤ N ≤ 1018).
Output
For each test case, print "ZiYES" if Ziya can win the game without matter of the Huseyn's moves, "HuseyNO" otherwise.
Example
Input: 3
1
2
3
Output: HuseyNO
HuseyNO
ZiYES
Added by: | Barish |
Date: | 2018-03-21 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |
Resource: | Deep places of my brain |
hide comments
2021-11-01 19:07:29
Hint : See how many consecutive n-1 move you should do and then apply recursion. |
|
2018-08-28 06:46:48
Beautiful problem!! |
|
2018-04-29 16:03:25
@barishnamazov Good problem. Re: Thank you :) Last edit: 2018-07-03 22:22:50 |
|
2018-03-22 21:05:52 hacker_sk
Thumbs UP for the problem. (Y) Re: Thanks :) Last edit: 2018-03-23 12:21:38 |
|
2018-03-22 03:26:42
Wanted my 666th classical to be devil-themed but couldn't refuse to take this on. Very nice problem. Re: Thanks much! It is really inspirational to see people like my problems :) Last edit: 2018-03-22 10:10:04 |
|
2018-03-21 21:11:52
another nice problem @barishnamazov Re: Thanks! I will try to add more problems :) Last edit: 2018-03-22 00:09:31 |