atcoder#AGC048D. [AGC048D] Pocky Game

[AGC048D] Pocky Game

Score : 900900 points

Problem Statement

There are NN piles of stones lying in a row. The ii-th pile from the left contains AiA_i stones.

Two players, FirstLeft and SecondRight, play a game. They alternately play a turn, with FirstLeft going first. In each turn, the player does the following operation:

  • In FirstLeft's turn: he removes one or more stones from the leftmost pile with one or more stones.
  • In SecondRight's turn: he removes one or more stones from the rightmost pile with one or more stones.

The player who becomes unable to play his turn loses. Determine the winner of the game when the players act optimally.

Solve TT test cases in an input file.

Constraints

  • 1T1001 \leq T \leq 100
  • 1N1001 \leq N \leq 100
  • 1Ai1091 \leq A_i \leq 10^9

Input

Input is given from Standard Input in the following format. The first line of input is as follows:

TT

Then, TT test cases follow, each of which is in the following format:

NN

A1A_1 A2A_2 \cdots ANA_N

Output

For each test case, print First if FirstLeft wins, and print Second if SecondRight wins. Use one line for each case.

3
1
10
2
3 2
3
2 1 2
First
First
Second

For example, in the third game, one possible scenario is as follows:

  • FirstLeft takes 22 stones from the leftmost pile. The piles now contain 0,1,20,1,2 stone(s).
  • SecondRight takes 11 stone from the rightmost pile. The piles now contain 0,1,10,1,1 stone(s).
  • FirstLeft takes 11 stone from the middle pile. The piles now contain 0,0,10,0,1 stone(s).
  • SecondRight takes 11 stone from the rightmost pile. The piles now contain 0,0,00,0,0 stones.
  • FirstLeft is unable to do his operation and loses.