Codeforces Round #124 (Div. 2) / A. Plate Game

來源:互聯網
上載者:User
A. Plate Gametime 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.

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確實偏重思維方面呐~~~第一次做CodeForces沒想到自己能想到這兒呵呵~


代碼:

#include <iostream>#include <cmath>using namespace std;const double pi=3.1415926;int main(){    int a,b,r;    cin>>a>>b>>r;    if ((2*r>a)||(2*r>b))    {        cout<<"Second"<<endl;        return 0;    }    cout<<"First"<<endl;    return 0;}


                                                                                                                                                                                                 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.