Piles of Pebbles

AtCoder
IDarc143_c
Time2000ms
Memory256MB
Difficulty
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$ [samples]
Samples
Input #1
2 1 1
3 3
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`.
Input #2
2 1 2
3 3
Output #2
Second
API Response (JSON)
{
  "problem": {
    "name": "Piles of Pebbles",
    "description": {
      "content": "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 Takaha",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "arc143_c"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "There are $N$ piles of pebbles. Initially, the $i$\\-th pile has $A_i$ pebbles.\nTakahashi and Aoki will play a game using these piles. They will alternately perform the following operation, with Takaha...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments