#P5932. Polygon Triangular Game

    ID: 19157 Type: Default 1000ms 256MiB

Polygon Triangular Game

Polygon Triangular Game

The game is played on a convex polygon with n vertices. The polygon is divided into n-2 triangles by drawing n-3 diagonals that intersect only at the vertices. One of these triangles is painted black, and the rest are white.

Two players alternate turns. On each turn, a player must remove one triangle from the polygon along one of the drawn diagonals. The player who removes the black triangle wins.

Assume that the polygon is triangulated in a fan style (i.e. one fixed vertex is connected to all other non-adjacent vertices), so that the triangles form a linear chain. In this chain the black triangle is given an index \( t \) (with \( 1\le t\le n-2 \)). Note that the two triangles at the ends of the chain (positions \( t=1 \) and \( t=n-2 \)) are on the boundary and can be removed immediately.

Under optimal play, determine which player will win the game. It can be shown that if the black triangle is at one of the two ends (i.e. \( t=1 \) or \( t=n-2 \)), then the first player can win immediately; otherwise, the second player can force a win.

Input Format (detailed below): A single line containing two space-separated integers \( n \) and \( t \), where \( n \) (with \( n\ge 4 \)) is the number of vertices of the polygon, and \( t \) (with \( 1\le t\le n-2 \)) is the index of the black triangle in the fan triangulation.

inputFormat

The input consists of one line with two integers: n and t:

  • n (\( n\ge4 \)): the number of vertices of the convex polygon.
  • t (\( 1\le t\le n-2 \)): the index of the black triangle (in the linear fan triangulation order).

outputFormat

Print a single line containing either First if the first player can force a win under optimal play, or Second otherwise.

sample

4 1
First