Plate Game CodeForces - 197A

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 a, b, r (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

题都看了好久,加上第一幅图把圆形画在边界上,再加上so that any point on any plate is located within the table‘s border,我是真的醉了。。。

题意:把圆盘放在桌子上,不要超出边界,谁先放不下就谁输。

第一个人开始放的下的话,就必放在桌子的几何中心上,那么由于对称性,周围的原盘必是偶数,所以放不下的时候恰恰该第二个人放,即第一个人必赢。。。

第一个人开始放不下的话,就该第二个人赢。。。

 1 #include<iostream>
 2 #include<algorithm>
 3 #include<cstdio>
 4 #include<cstring>
 5 #include<string>
 6 #include<cmath>
 7 using namespace std;
 8 typedef long long ll;
 9
10 int main()
11 {   int a,b,r;
12     cin>>a>>b>>r;
13     if(a>=2*r&&b>=2*r) cout<<"First"<<endl;
14     else cout<<"Second"<<endl;
15 }
时间: 2024-12-21 14:55:57

Plate Game CodeForces - 197A的相关文章

[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

Codeforces Round #300-Cutting Banner(substr函数的应用)

Cutting Banner Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Description A large banner with word CODEFORCES was ordered for the 1000-th onsite round of Codeforcesω that takes place on the Miami beach. Un

Codeforces Gym 100500F Problem F. Door Lock 二分

Problem F. Door LockTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100500/attachments Description It was a beautiful night at Yekaterinburg, the sky was crystal clear with no clouds, and the view of the moon and the stars was

codeforces A. Valera and Plates 题解

Valera is a lazy student. He has m clean bowls and k clean plates. Valera has made an eating plan for the next n days. As Valera is lazy, he will eat exactly one dish per day. At that, in order to eat a dish, he needs exactly one clean plate or bowl.

【codeforces 718E】E. Matvey&#39;s Birthday

题目大意&链接: http://codeforces.com/problemset/problem/718/E 给一个长为n(n<=100 000)的只包含‘a’~‘h’8个字符的字符串s.两个位置i,j(i!=j)存在一条边,当且仅当|i-j|==1或s[i]==s[j].求这个无向图的直径,以及直径数量. 题解:  命题1:任意位置之间距离不会大于15. 证明:对于任意两个位置i,j之间,其所经过每种字符不会超过2个(因为相同字符会连边),所以i,j经过节点至多为16,也就意味着边数至多

Codeforces 124A - The number of positions

题目链接:http://codeforces.com/problemset/problem/124/A Petr stands in line of n people, but he doesn't know exactly which position he occupies. He can say that there are no less than a people standing in front of him and no more than b people standing b

Codeforces 841D Leha and another game about graph - 差分

Leha plays a computer game, where is on each level is given a connected graph with n vertices and m edges. Graph can contain multiple edges, but can not contain self loops. Each vertex has an integer di, which can be equal to 0, 1 or  - 1. To pass th

Codeforces Round #286 (Div. 1) A. Mr. Kitayuta, the Treasure Hunter DP

链接: http://codeforces.com/problemset/problem/506/A 题意: 给出30000个岛,有n个宝石分布在上面,第一步到d位置,每次走的距离与上一步的差距不大于1,问走完一路最多捡到多少块宝石. 题解: 容易想到DP,dp[i][j]表示到达 i 处,现在步长为 j 时最多收集到的财富,转移也不难,cnt[i]表示 i 处的财富. dp[i+step-1] = max(dp[i+step-1],dp[i][j]+cnt[i+step+1]) dp[i+st

Codeforces 772A Voltage Keepsake - 二分答案

You have n devices that you want to use simultaneously. The i-th device uses ai units of power per second. This usage is continuous. That is, in λ seconds, the device will use λ·ai units of power. The i-th device currently has bi units of power store