CodeForces - 513A Game

CodeForces - 513A
Game

Description

Two players play a simple game. Each player is provided with a box with balls. First player's box contains exactly n1 balls and second player's box contains exactly n2 balls. In one move first player can take from 1 to k1 balls from his box and throw them away. Similarly, the second player can take from 1 to k2balls from his box in his move. Players alternate turns and the first player starts the game. The one who can't make a move loses. Your task is to determine who wins if both players play optimally.

Input

The first line contains four integers n1, n2, k1, k2. All numbers in the input are from 1 to 50.

This problem doesn't have subproblems. You will get 3 points for the correct submission.

Output

Output "First" if the first player wins and "Second" otherwise.

Sample Input

Input
2 2 1 2
Output
Second
Input
2 1 1 1
Output
First

Hint

Consider the first sample test. Each player has a box with 2 balls. The first player draws a single ball from his box in one move and the second player can either take 1 or 2 balls from his box in one move. No matter how the first player acts, the second player can always win if he plays wisely.

Source

Rockethon 2015

Description

Two players play a simple game. Each player is provided with a box with balls. First player's box contains exactly n1 balls and second player's box contains exactly n2 balls. In one move first player can take from 1 to k1 balls from his box and throw them away. Similarly, the second player can take from 1 to k2balls from his box in his move. Players alternate turns and the first player starts the game. The one who can't make a move loses. Your task is to determine who wins if both players play optimally.

Input

The first line contains four integers n1, n2, k1, k2. All numbers in the input are from 1 to 50.

This problem doesn't have subproblems. You will get 3 points for the correct submission.

Output

Output "First" if the first player wins and "Second" otherwise.

Sample Input

Input
2 2 1 2
Output
Second
Input
2 1 1 1
Output
First

Hint

Consider the first sample test. Each player has a box with 2 balls. The first player draws a single ball from his box in one move and the second player can either take 1 or 2 balls from his box in one move. No matter how the first player acts, the second player can always win if he plays wisely.

Source

Rockethon 2015

为了取胜,必然双方每次拿一个,只需比较你,n1,n2即可

/*  
    coder: Shawn_Xue  
    date: 2015.3.16  
    result: AC  
*/  
#include <iostream>

using namespace std;

int main()
{
    int m, n, k1, k2;
    while(cin >> m >> n >> k1 >> k2)
    {
        if(m > n)
            cout << "First" << endl;
        else
            cout << "Second" << endl;
    }
    return 0;
}




你可能感兴趣的:(CodeForces - 513A Game)