100 atcoder#AGC002E. [AGC002E] Candy Piles
[AGC002E] Candy Piles
Problem Statement
There are piles of candies on the table. The piles are numbered through . At first, pile contains candies.
Snuke and Ciel are playing a game. They take alternating turns. Snuke goes first. In each turn, the current player must perform one of the following two operations:
- Choose a pile with the largest number of candies remaining, then eat all candies of that pile.
- From each pile with one or more candies remaining, eat one candy.
The player who eats the last candy on the table, loses the game. Determine which player will win if both players play the game optimally.
Constraints
Input
The input is given from Standard Input in the following format:
Output
If Snuke will win, print First
. If Ciel will win, print Second
.
2
1 3
First
At the beginning of the game, pile contains the most candies. If Snuke eats all candies of this pile, Ciel has no choice but to eat the last candy.
3
1 2 1
First
If Snuke eats one candy from each pile, Ciel is again left with the last candy.
3
1 2 3
Second