AtCoder Grand Contest 010
翻译中…
Problem Statement
翻译中…
There are $N$ integers written on a blackboard. The $i$-th integer is $A_i$, and the greatest common divisor of these integers is $1$.
翻译中…
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
$2$, and subtract$1$from the integer. - Then, divide all the integers on the black board by
$g$, where$g$is the greatest common divisor of the integers written on the blackboard.
翻译中…
The player who is left with only $1$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
翻译中…
$1 ≦ N ≦ 10^5$$1 ≦ A_i ≦ 10^9$- The greatest common divisor of the integers from
$A_1$through$A_N$is$1$.
翻译中…
Input
翻译中…
The input is given from Standard Input in the following format:
翻译中…
N
A_1 A_2 … A_N
翻译中…
Output
翻译中…
If Takahashi will win, print First. If Aoki will win, print Second.
翻译中…
样例
Input #1
3
3 6 7
Output #1
First
Takahashi, the first player, can win as follows:
- Takahashi subtracts $1$ from $7$. Then, the integers become: $(1,2,2)$.
- Aoki subtracts $1$ from $2$. Then, the integers become: $(1,1,2)$.
- Takahashi subtracts $1$ from $2$. Then, the integers become: $(1,1,1)$.
Input #2
4
1 2 4 8
Output #2
First
Input #3
5
7 8 8 8 8
Output #3
Second
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。