201432: [AtCoder]ARC143 C - Piles of Pebbles
Memory Limit:1024 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Score : $600$ points
Problem Statement
There are $N$ piles of pebbles. Initially, the $i$-th pile has $A_i$ 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: $X$ pebbles if this operation is performed by Takahashi, and $Y$ 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
- $1 \leq N \leq 2\times 10^5$
- $1 \leq X, Y \leq 10^9$
- $1 \leq A_i \leq 10^9$
Input
Input is given from Standard Input in the following format:
$N$ $X$ $Y$ $A_1$ $A_2$ $\cdots$ $A_N$
Output
If it is Takahashi who will win the game, print First
; if it is Aoki, print Second
.
Sample Input 1
2 1 1 3 3
Sample Output 1
First
Here is one possible progression of the game.
- Takahashi removes $1$ pebble from both piles.
- Aoki removes $1$ pebble from the $1$-st pile.
- Takahashi removes $1$ pebble from the $1$-st pile.
- Aoki removes $1$ pebble from the $2$-nd pile.
- Takahashi removes $1$ pebble from the $2$-nd pile.
No matter how Aoki plays, Takahashi can always win, so the answer is First
.
Sample Input 2
2 1 2 3 3
Sample Output 2
Second