Halve or Decrement
A single pile of n stones; a move either removes one stone, or removes half (rounded down) of the pile. The player who cannot move loses. For each query n, print the winner under perfect play.
Input: the first line has Q; each of the next Q lines has a pile size n.
Output: one line per query: FIRST or SECOND.
Constraints:
- 1 ≤ Q ≤ 104
- 0 ≤ n ≤ 104
Sample Tests
Input 1
3 1 4 6
Output 1
FIRST FIRST FIRST
Discussion (opens after you solve — no spoilers before)
No comments yet.