P15746 [JAG 2024 Summer Camp #3] Paper Cut Game

Description

There is a sheet of paper consisting of a grid with $N$ rows and $M$ columns. Two players participate in a game with this paper. Each player alternates moves, performing exactly one of the following actions on their turn. - Cut the paper vertically along one of the grid lines to split the paper into two, and keep only the part with more cells. If both parts have the same number of cells, keep only one of them. - Cut the paper horizontally along one of the grid lines to split the paper into two, and keep only the part with more cells. If both parts have the same number of cells, keep only one of them. The player who is unable to make a move loses, while the other player wins. Given the size of the paper, determine the winner, assuming both players play optimally. You have $T$ test cases to solve.

Input Format

The input consists of a multiple test case of the following format. $$\begin{aligned} & T \\ & \text {case}_{1} \\ & \vdots \\ & \text {case}_{T} \end{aligned}$$ The first line contains an integer $T$ between $1$ and $200,000$, inclusive. The $(i+1)$-th line corresponds to the $i$-th test case. Each line contains two integers, $N$ and $M$, representing the height and width of the paper, respectively. Both $N$ and $M$ are between $1$ and $10^{18}$, inclusive.

Output Format

Print $T$ lines. For each test case, the $i$-th line should contain **First** if the first player wins in the $i$-th test case, and **Second** otherwise.