题目描述
You've got a rectangular table with length a and width b and the infinite number of plates of radius r. Two players play the following game: they take turns to put the plates on the table so that the plates don't lie on each other (but they can touch each other), and so that any point on any plate is located within the table's border. During the game one cannot move the plates that already lie on the table. The player who cannot make another move loses. Determine which player wins, the one who moves first or the one who moves second, provided that both players play optimally well.
输入
A single line contains three space-separated integers a, b, r (1 ≤ a, b, r ≤ 100) — the table sides and the plates' radius, correspondingly.
输出
If wins the player who moves first, print "First" (without the quotes). Otherwise print "Second" (without the quotes).
样例输入
【样例1】 5 5 2 【样例2】 6 7 4
样例输出
【样例1】 First 【样例2】 Second
提示
In the first sample the table has place for only one plate. The first player puts a plate on the table, the second player can't do that and loses.
In the second sample the table is so small that it doesn't have enough place even for one plate. So the first player loses without making a single move.
思路
要是能放下盘子,先手赢,放不下盘子,后手赢。
就比如玩一个小游戏,画一个九宫格。游戏规则是这样的,每人放一颗棋子上去,谁填掉最后一个空就赢,经过简单计算发现,先手的必赢,后手必输。
其实,这个和这个小游戏差不多,但这个是放盘子,盘子可以大于棋盘,因此棋盘小于盘子时,后手赢。
代码如下
#include<iostream>
using namespace std;
int main()
{
int a, b, r;
cin >> a >> b >> r;
if (a < r * 2 || b < r * 2)
{
cout << "Second";
}
else
{
cout << "First";
}
return 0;
}