No.2285 Make A Unit Square
Problem Statement
You are given positive integers $a, b$.
Two players play a game on the $xy$-coordinate plane. Initially, $4$ lines $x = 0, x = a, y = 0, y = b$ are drawn on the plane. Starting with the first player, the two players alternately perform one of the following operations.
- Choose an integer $k$ such that $0 < k < a$ and the line $x = k$ has not been drawn, and draw the line $x = k$ on the plane.
- Choose an integer $l$ such that $0 < l < b$ and the line $y = l$ has not been drawn, and draw the line $y = l$ on the plane.
The player who first makes a $1 \times 1$ square on the plane wins the game, and the game ends at that point. More precisely, if, after a player performs an operation, there exist integers $k, l$ satisfying $0 \le k < a, 0 \le l < b$ such that the lines $x = k, x = k + 1, y = l, y = l + 1$ are all drawn, that player wins the game, and the game ends at that point.
Determine which player wins the game when both players play optimally.
You are given $T$ test cases; solve each of them.
Input
$T$ test$_1$ $\vdots$ test$_T$
Here, test$_i$ represents the $i$-th test case, given in the following format.
$a \ b$
- All input values are integers.
- $1 \le T \le 10^5$
- $2 \le a, b \le 10^9$
Output
Output $T$ lines. On the $i$-th line, output First if the first player wins, and Second if the second player wins.
Sample
Sample 1
Input
3 5 3 2 2 10293394 32893041
Output
First Second First
Here is an example of how the game may proceed in the first test case.
- The first player draws the line $x = 2$.
- The second player draws the line $y = 2$.
- The first player draws the line $x = 3$.
Immediately after the $3$-rd operation, a square enclosed by the lines $x = 2, x = 3, y = 2, y = 3$ is formed on the plane, so the first player wins.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
cureskol