atcoder#ARC143C. [ARC143C] Piles of Pebbles
[ARC143C] Piles of Pebbles
Score : points
Problem Statement
There are piles of pebbles. Initially, the -th pile has pebbles.
Takahashi and Aoki will play a game using these piles. They will alternately perform the following operation, with Takahashi going first, and the one who becomes unable to do so loses the game.
- Choose one or more piles, and remove the following number of pebbles from each chosen pile: pebbles if this operation is performed by Takahashi, and pebbles if performed by Aoki. Here, a pile with an insufficient number of pebbles cannot be chosen.
Determine the winner of the game if both players play optimally.
Constraints
Input
Input is given from Standard Input in the following format:
Output
If it is Takahashi who will win the game, print First
; if it is Aoki, print Second
.
2 1 1
3 3
First
Here is one possible progression of the game.
- Takahashi removes pebble from both piles.
- Aoki removes pebble from the -st pile.
- Takahashi removes pebble from the -st pile.
- Aoki removes pebble from the -nd pile.
- Takahashi removes pebble from the -nd pile.
No matter how Aoki plays, Takahashi can always win, so the answer is First
.
2 1 2
3 3
Second