Divide and conquer
Maxim and Yurko enjoy playing a game called "Divide and Destroy."
The game begins with a single pile containing n[i]
stones. Yurko and Maxim take turns, with Yurko going first. During his turn, Yurko can split any pile into two smaller piles. The stones in these new piles are divided as equally as possible, with one pile possibly having one more stone than the other if an equal split isn't possible. On his turn, Maxim can destroy any pile by removing it from the game. A player loses if, at the start of their turn, all piles consist of just one stone each.
Determine the winner, assuming both players play optimally.
Input
The first line contains the integer t, representing the number of test cases. The second line contains t integers n[i]
, each representing the initial number of stones in a game.
Output
For each test case, output a line with the winner's name: "Maxim" if Maxim wins, or "Yurko" if Yurko wins.
Evaluation:
40% of the tests: t ≤
1000
;n[i]
≤1000
20% of the tests: t ≤
10^4
;n[i]
≤10^9
20% of the tests: t ≤
10^4
;n[i]
≤10^18
30% of the tests: t ≤
5
*10^5
;n[i]
≤10^18