atcoder#AGC010D. [AGC010D] Decrementing
[AGC010D] Decrementing
Score : points
Problem Statement
There are integers written on a blackboard. The -th integer is , and the greatest common divisor of these integers is .
Takahashi and Aoki will play a game using these integers. In this game, starting from Takahashi the two player alternately perform the following operation:
- Select one integer on the blackboard that is not less than , and subtract from the integer.
- Then, divide all the integers on the black board by , where is the greatest common divisor of the integers written on the blackboard.
The player who is left with only s on the blackboard and thus cannot perform the operation, loses the game. Assuming that both players play optimally, determine the winner of the game.
Constraints
- The greatest common divisor of the integers from through is .
Input
The input is given from Standard Input in the following format:
…
Output
If Takahashi will win, print First
. If Aoki will win, print Second
.
3
3 6 7
First
Takahashi, the first player, can win as follows:
- Takahashi subtracts from . Then, the integers become: .
- Aoki subtracts from . Then, the integers become: .
- Takahashi subtracts from . Then, the integers become: .
4
1 2 4 8
First
5
7 8 8 8 8
Second