Universal Cup Judging System

Universal Cup

时间限制: 3.0 s 内存限制: 1024 MB 总分: 100 可 Hack ✓
统计

$n$ 個の石の山があり、$i$ 番目の山には $a_i$ 個の石があります。

2 人のプレイヤーが交互に手を指します。1 回の手で、手番のプレイヤーは山を 1 つ選び、そこから正の個数 $k$ の石を取り除きます。この手が許されるのは、$k$ の二進表記に含まれる $1$ の個数が $m$ 以下である場合に限ります。

手を指せなくなったプレイヤーが負けます。両者が最適にプレイするとき、どちらが勝つかを求めてください。

入力

最初の行には、テストケース数を表す整数 $t$ ($1\le t\le 10^4$) が 1 つ与えられます。

各テストケースは 2 行で記述されます。最初の行には、山の個数と、取り除く個数の二進表記に含まれてよい $1$ の個数の上限を表す 2 つの整数 $n,m$ ($1\le n\le 2\cdot 10^5$, $1\le m\le 60$) が与えられます。

2 行目には、各山の石の個数を表す $n$ 個の整数 $a_1,a_2,\ldots,a_n$ ($1\le a_i\le 10^{18}$) が与えられます。これらの個数は互いに異なるとは限りません。

すべてのテストケースにわたる $n$ の合計が $2\cdot 10^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=111_2$ には $1$ が 3 個含まれるため、先手は $7$ 個の石をすべて取ることはできません。許されるどの手を指しても、後手が勝つ局面になることを確認できます。

2 番目のテストケースでは、先手は最初の山から $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.