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

Input

题意翻译

[_edge_](https://www.luogu.com.cn/user/208653) 有 $N$ 堆鹅卵石,她邀请高桥和青木参加一个游戏。 高桥和青木将轮流操作,高桥先手,当某个人无法操作是那个人就输了。 游戏有以下规则: + 当前操作者需要选择一个或多个堆,移走 $X$ 或 $Y$ 颗石子。如果当前是高桥操作,则移走 $X$ 颗,是青木则移走 $Y$ 颗。 + 所有选择的堆的石子数均需大于等于移走的石子数。 若两个人都足够聪明,谁会赢? Translated by [Tx_Lcy](https://www.luogu.com.cn/user/253608)

加入题单

算法标签: