Universal Cup Judging System

Universal Cup

Süre Sınırı: 3.0 s Bellek Sınırı: 1024 MB Toplam puan: 100 Hack'lenebilir ✓
İstatistikler

有 $n$ 堆石子;第 $i$ 堆有 $a_i$ 颗石子。

两名玩家轮流行动。每次行动时,当前玩家选择一堆石子,并从中取走正整数 $k$ 颗石子。只有当 $k$ 的二进制表示中至多有 $m$ 个 $1$ 时,这次行动才被允许。

无法行动的玩家输掉游戏。若两名玩家都采用最优策略,判断谁会获胜。

输入格式

第一行包含一个整数 $t$($1\le t\le10^4$),表示测试用例的数量。

每个测试用例由两行描述。第一行包含两个整数 $n$ 和 $m$($1\le n\le2\cdot10^5$,$1\le m\le60$),分别表示石子堆数,以及取走的石子数量的二进制表示中允许出现的 $1$ 的最大个数。

第二行包含 $n$ 个整数 $a_1,a_2,\ldots,a_n$($1\le a_i\le10^{18}$),表示各堆的石子数量。这些数量不一定互不相同。

保证所有测试用例的 $n$ 之和不超过 $2\cdot10^5$。

输出格式

对于每个测试用例,若先手玩家获胜,输出 First;否则输出 Second。

样例

输入格式 1

3
1 2
7
2 1
5 6
3 2
7 14 21

输出格式 1

Second
First
Second

说明

在第一个测试用例中,$m=2$,唯一一堆中有 $7$ 颗石子。先手玩家不能取走全部 $7$ 颗石子,因为 $7=111_2$ 的二进制表示中有三个 $1$。可以验证,每一种允许的行动都会使局面变为后手玩家获胜的局面。

在第二个测试用例中,先手玩家可以从第一堆取走 $2$ 颗石子,使两堆的石子数量分别变为 $3$ 和 $6$。

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.