#P15746. [JAG 2024 Summer Camp #3] Paper Cut Game
[JAG 2024 Summer Camp #3] Paper Cut Game
题目描述
There is a sheet of paper consisting of a grid with rows and 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 test cases to solve.
输入格式
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 between and , inclusive.
The -th line corresponds to the -th test case. Each line contains two integers, and , representing the height and width of the paper, respectively. Both and are between and , inclusive.
输出格式
Print lines. For each test case, the -th line should contain First if the first player wins in the -th test case, and Second otherwise.
5
1 1
1 2
3 3
7 3
999999999999999999 1000000000000000000
Second
First
Second
Second
First