【CodeForces】Plate Game(博弈)


原文:

http://blog.csdn.net/zzp441524586/article/details/7659825


A. Plate Game
time limit per test
 2 seconds
memory limit per test
 256 megabytes
input
 standard input
output
 standard output

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.

Input

A single line contains three space-separated integers abr (1 ≤ a, b, r ≤ 100) — the table sides and the plates' radius, correspondingly.

Output

If wins the player who moves first, print "First" (without the quotes). Otherwise print "Second" (without the quotes).

Sample test(s)
input
5 5 2
output
First
input
6 7 4
output
Second
Note

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.

【CodeForces】Plate Game(博弈)_第1张图片

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.

【CodeForces】Plate Game(博弈)_第2张图片


分析:     
水题,一开始觉得挺麻烦的,但是如果自己认真分析一下就发现,只有两种情况:
一,一个盘子都摆不下(题中第二个样例),则第二个人获胜;
二,只要能放下盘子,则只要第一个人先把第一个盘子放到正中央,则接下来无论第二个人怎么放盘子,第一个人都可以找到一个对称的位置放下,所以这种情况第一个人一定能获胜。
很简单吧~~看来CodeForces确实偏重思维方面呐~~~第一次做CodeForces没想到自己能想到这儿呵呵~


自己的代码:


#include 
#include 
using namespace std;
int main()
{
    int a,b,r;
    while(scanf("%d%d%d",&a,&b,&r)!=EOF)
    {
        puts((2*r>min(a,b))?"Second":"First");
    }
    return 0;
}

你可能感兴趣的:(博弈,博弈)