#abc297g. G - Constrained Nim 2

G - Constrained Nim 2

Score : 600600 points

问题描述

设有 NN 堆石头。最初,第 ii 堆有 AiA_i 个石头。Taro 一号和 Jiro 二号将通过这些石头堆进行一场对决游戏。

Taro 一号和 Jiro 二号轮流执行以下操作,由 Taro 一号先手:

  • 选择一堆石头,并从中移除 LLRR 个(包含)石头。

无法做出移动的玩家判负,另一方则判胜。若两人均采取最优策略,谁将赢得比赛?

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

There are NN piles of stones. Initially, the ii-th pile contains AiA_i stones. With these piles, Taro the First and Jiro the Second play a game against each other.

Taro the First and Jiro the Second make the following move alternately, with Taro the First going first:

  • Choose a pile of stones, and remove between LL and RR stones (inclusive) from it.

A player who is unable to make a move loses, and the other player wins. Who wins if they optimally play to win?

Constraints

  • 1N2×1051\leq N \leq 2\times 10^5
  • 1LR1091\leq L \leq R \leq 10^9
  • 1Ai1091\leq A_i \leq 10^9
  • All values in the input are integers.

Input

The input is given from Standard Input in the following format:

NN LL RR

A1A_1 A2A_2 \ldots ANA_N

Output

Print First if Taro the First wins; print Second if Jiro the Second wins.

Sample Input 1

3 1 2
2 3 3

Sample Output 1

First

Taro the First can always win by removing two stones from the first pile in his first move.

Sample Input 2

5 1 1
3 1 4 1 5

Sample Output 2

Second

Sample Input 3

7 3 14
10 20 30 40 50 60 70

Sample Output 3

First

update @ 2024/3/10 12:21:05