#K61692. Determining the Winner in a 2xN Grid Game
Determining the Winner in a 2xN Grid Game
Determining the Winner in a 2xN Grid Game
You are given a game played on a 2 x N grid. In this game, two players – Ankit and Neha – take turns to make moves on the grid. The outcome of the game is determined solely by the length of the grid, N. It is known that for N = 1 and N = 2 the game always ends in a draw, because there is not enough space for a winning strategy. For all grids with N \ge 3, the first player, Ankit, has a winning strategy if both play optimally.
Your task is to determine the result of the game given the grid length. For each test case, you must output the result in the format "Case #x: y", where x is the test case number (starting at 1) and y is the outcome: either "Draw" or "Ankit".
The decision function can be summarized by the following rule in LaTeX:
\(\text{result}(N) = \begin{cases} \text{Draw} & \text{if } N = 1 \text{ or } N = 2,\\ \text{Ankit} & \text{if } N \ge 3. \end{cases}\)
inputFormat
The input begins with a single integer T, representing the number of test cases. Each of the following T lines contains one integer N, the length of the grid.
outputFormat
For each test case, output a single line in the format "Case #x: y", where x is the test case number (starting from 1) and y is either "Draw" or "Ankit" based on the game result.## sample
1
1
Case #1: Draw
</p>