Under construction

Still being built. Things may change

Singularity of the Nim

Time limit2sMemory limit1024 MB

Summary
Given a staircase game where taking x coins from a step adds x^j coins to each lower step j, decide whether the first or second player wins.
Level

Hard8 of 10

Topics
Game theory, Math, Implementation
Solved
No attempts yet

Problem

Exponential staircase nim is a game for two players on a staircase of NN steps, with a huge number of coins. The players take turns. At the start, each step has some coins on it.

Let CiC_i be the number of coins on the ii-th step from the bottom. The figure below shows an example with N=4N=4 and C=[3,1,0,2]C=[3, 1, 0, 2].

On each turn, a player picks a step that has coins and takes between 1 and PP coins from it.

If a player takes xx coins from the ii-th step from the bottom, new coins are added to every step below it, with the amount growing exponentially in xx. Precisely, xjx^j coins are added to the jj-th step from the bottom for each j<ij<i.

The figures below show the result of choosing i=2i=2, x=1x=1 from the initial example, and the result of choosing i=4i=4, x=2x=2.

If a player takes many coins from a high step, the game grows faster than anyone can follow. You will see a singularity when that happens.

The game goes on until someone has no coins left to take. That player loses.

Assume both players play to win. Determine whether the first or the second player wins.

Input

The first line contains the number of test cases TT. Then each test case follows on two lines, for a total of 2T2T lines.

The first line of each test case contains the number of steps NN and the maximum number of coins PP that can be taken in one turn.

The second line contains NN integers C1,C2,⋯ ,CNC_1, C_2, \cdots, C_N, the number of coins on each step at the start of the game.

Output

For each test case, print one line. Print First if the first player wins, and Second if the second player wins.

Constraints

  • 1≤N≤200 0001 \leq N \leq 200\,000
  • The sum of all NN values is at most 200 000200\,000.
  • 1≤P≤10181 \leq P \leq 10^{18}
  • 0≤Ci≤10180 \leq C_i \leq 10^{18}
  • CN≠0C_N \neq 0

Examples1

  1. Example 1

    Input
    4
    1 3
    30
    2 5
    1 2
    4 2
    3 1 0 2
    5 4
    100 100 100 100 100
    
    Expected output
    First
    First
    Second
    Second