300922: CF176C. Playing with Superglue
Memory Limit:256 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Playing with Superglue
题意翻译
玩家A和玩家B在一个 $n * m$ 的棋盘上玩一个游戏。棋盘上有两个小圆片,玩家A的目标是把两个圆片移动到同一个格子中,而玩家B的目标是用胶水阻止他。 具体来说,玩家A先手:他可以选择自己一个未被粘在格子上的圆片并将其向上下左右任意一个方向中移动一格(不能出界)。在玩家A移动时,有可能会有格子已经被B用胶水覆盖了,A可以把圆片移到上面,但是这样他就不能再移动这个圆片了。 玩家B后手:他选择一个未被胶水覆盖也没有圆片的地方,并将这个地方涂上胶水。这样这个格子就被胶水覆盖了,玩家A的圆片在移动到上面的时候会被粘住,不能再移动。 当玩家A的两个圆片被移动到同一个格子中的时候(就算这两个圆片有可能最终都被粘在了这个格子上),玩家A胜利。当玩家B使玩家A在不能移动(两个圆片都被粘在不同的格子里)时,玩家B胜利。 现在给你 $n, m$ 和两个圆片初始的坐标(保证不同),且我们认为玩家A和玩家B每一步都会选择最优方案,问他们两个谁必赢?(玩家A赢时输出First,否则输出Second)题目描述
Two players play a game. The game is played on a rectangular board with $ n×m $ squares. At the beginning of the game two different squares of the board have two chips. The first player's goal is to shift the chips to the same square. The second player aims to stop the first one with a tube of superglue. We'll describe the rules of the game in more detail. The players move in turns. The first player begins. With every move the first player chooses one of his unglued chips, and shifts it one square to the left, to the right, up or down. It is not allowed to move a chip beyond the board edge. At the beginning of a turn some squares of the board may be covered with a glue. The first player can move the chip to such square, in this case the chip gets tightly glued and cannot move any longer. At each move the second player selects one of the free squares (which do not contain a chip or a glue) and covers it with superglue. The glue dries long and squares covered with it remain sticky up to the end of the game. If, after some move of the first player both chips are in the same square, then the first player wins. If the first player cannot make a move (both of his chips are glued), then the second player wins. Note that the situation where the second player cannot make a move is impossible — he can always spread the glue on the square from which the first player has just moved the chip. We will further clarify the case where both chips are glued and are in the same square. In this case the first player wins as the game ends as soon as both chips are in the same square, and the condition of the loss (the inability to move) does not arise. You know the board sizes and the positions of the two chips on it. At the beginning of the game all board squares are glue-free. Find out who wins if the players play optimally.输入输出格式
输入格式
The first line contains six integers $ n $ , $ m $ , $ x_{1} $ , $ y_{1} $ , $ x_{2} $ , $ y_{2} $ — the board sizes and the coordinates of the first and second chips, correspondingly ( $ 1<=n,m<=100 $ ; $ 2<=n×m $ ; $ 1<=x_{1},x_{2}<=n $ ; $ 1<=y_{1},y_{2}<=m $ ). The numbers in the line are separated by single spaces. It is guaranteed that the chips are located in different squares.
输出格式
If the first player wins, print "First" without the quotes. Otherwise, print "Second" without the quotes.
输入输出样例
输入样例 #1
1 6 1 2 1 6
输出样例 #1
First
输入样例 #2
6 5 4 3 2 1
输出样例 #2
First
输入样例 #3
10 10 1 1 10 10
输出样例 #3
Second