TopCoder

User's AC Ratio

100.0% (2/2)

Submission's AC Ratio

100.0% (2/2)

Tags

Description

桌面上有 $n$ 根棍子,雙方輪流操作,每個人每次可以拿走 $1$ 到 $k$ 根棍子,不能拿的人就輸了。請問在雙方皆做出最佳策略的情形下,先手會輸還是會贏?

Input Format

輸入第一行有一個正整數 $t$,代表測資筆數。

接下來 $t$ 行,每行有兩個正整數 $n, k$,代表一筆測資。

  • $1 \leq t \leq 10^ 5$
  • $1 \leq n, k \leq 10^ {18}$

Output Format

對於每筆測資輸出一行,如果該筆測資會由先手獲勝,請輸出 First,否則輸出 Second

Sample Input 1

5
10 3
8 3
1 100
56562 48763
14 1

Sample Output 1

First
Second
First
First
Second

Hints

Problem Source

程式解題社教學題。

Subtasks

No. Testdata Range Constraints Score
1 0 範例測資 0
2 0~9 無額外限制 100

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 1000 262144 65536 1 2
1 1000 262144 65536 2
2 1000 262144 65536 2
3 1000 262144 65536 2
4 1000 262144 65536 2
5 1000 262144 65536 2
6 1000 262144 65536 2
7 1000 262144 65536 2
8 1000 262144 65536 2
9 1000 262144 65536 2