[CodeForces - 197A] A - Plate Game

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[CodeForces - 197A] A - Plate Game相关的知识,希望对你有一定的参考价值。

 

A - Plate Game

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).

Example

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.

技术分享

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.

技术分享

题目大意就是有一个a*b的地方,在上面放半径为r的圆,要求圆两两不能相交(可以相切),也不能越出边界,两人轮流放,最后谁胜.

一开始并没有思路,就先去扛T2,T3了.后来T4一直WA,就回来想T1了.看了看大家的提交,代码长度都很短,我就纳闷了--------会不会是O(1)的?

后来想了一下,第一个操作的人如果可以放,他会放在哪里?应该是正中间.为什么?

因为先手放了一个正中间后,后手要么没地方放,要么有,但是先手也有,而且先手的操作与之对称,这样先手总是不会先面临不能放的局面.

所以,如果先手第一个放的下,那他就必胜了.

技术分享
1 #include<cstdio>
2 using namespace std;
3 int main(){
4     int a,b,r; scanf("%d%d%d",&a,&b,&r);
5     if (2*r>a||2*r>b) puts("Second"); else puts("First"); 
6     return 0;
7 }
View Code

 

以上是关于[CodeForces - 197A] A - Plate Game的主要内容,如果未能解决你的问题,请参考以下文章

CF197A Plate Game

Codeforces 1106F(数论)

Codeforces 807C - Success Rate

CodeForces 797E 部分dp

codeforces:Prefix Sums

Codeforces Round #341 (Div. 2) C. Wet Shark and Flowers(简单容斥)