Two Piles, Diagonal Moves
Two piles of sizes A and B. A move either removes any positive number from ONE pile, or removes the SAME positive number from BOTH piles. Last to move wins. Determine the winner.
Input: one line with two integers A and B.
Output: FIRST or SECOND.
Constraints:
- 0 ≤ A, B ≤ 109
Sample Tests
Input 1
1 2
Output 1
SECOND
Input 2
0 0
Output 2
SECOND
Input 3
3 5
Output 3
SECOND
Discussion (opens after you solve — no spoilers before)
No comments yet.