Timer is Running

Game of cells
Submissions: 1263   Accuracy:


  Difficulty: Easy   Marks: 2

Given a NxNxN grid. Harvey and Mike are playing a game. The rule of the game is simple. Each of them in their turn choses a cell and mark it with their initials. But the catch here is once a cell is marked they can't chose any of the adjacent(sharing a common face not the just the edge) cell to it. Since Harvey is senior he goes first. Both of them play optimally. The player with no move remaining loses the game. If harvey wins the game print “Harvey” otherwise print “Mike”.

Input :
The first line contains integer T, denoting number of test cases. Then T test cases follow. The first line of each test case contains an integer N, denoting the dimensions of the grid.

Output :
Print the answer of each test case in a new line.

Constraints :
1 <= T <= 100
1 <= N <= 1018

Input :


Output :

Testcase 1: 2*2*2 grid they have 8 blocks, if Harvey marks any of the cell the then Mark has only three options left, and once Mike chooses any one of the three, then Harvey has no other option so mike wins. 

** For More Input/Output Examples Use 'Expected Output' option **

Author: Sonesh Shukla

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.