All submissions for this problem are available.
Prakhar and Sonu are inventive Guys.They invented a very simple game.They decided to play this game k times. The player who is the loser of the i-th game makes the first move in the (i + 1)-th game. Guys decided that the winner of all games is the player who wins the last (K-th) game. They already started the game. Assume yourself as a referee of the game,you have to answer who wins the game if both players will play optimally.
Note: A player is considered winner of the game in two cases:
1. He wins the game
2. The opponent loses the game
All the K games will follow one of the three conditions:
1 1 : A player can either win the game or lose the game.
1 0 : A player can win the game but can't lose the game.
0 1 : A player can lose the game but can't win the game.
The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows.The first line of each test case contains two integers(only zero or one) describing the condition followed by the K games.
The second line of each test case contains a single integer K denoting the total number of games.
For each test case,If the player who moves first wins, print "First", otherwise print "Second" (without the quotes).
- 1 ≤ T ≤ 10^4
- 1 ≤ K ≤ 10^9
Input: 2 1 0 2 0 1 100 Output: Second Second
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, CS2, PYP3|
Fetching successful submissions
If you are still having problems, see a sample solution here.