Plyatsok
Limits: 2 sec., 256 MiB
This statement was translated automatically from Ukrainian. In case of any discrepancy, the Ukrainian version is authoritative.
We will call a simple polygon on the plane a plyatsok if it satisfies all of the following conditions:
all vertices have integer coordinates,
the sides are parallel to the coordinate axes,
the size of each interior angle of the polygon is equal to 90\(^\circ\) or 270\(^\circ\),
there are no two consecutive angles of the polygon with a size of 270\(^\circ\).
Two players can play an interesting game using a plyatsok. They take
turns cutting the plyatsok into two parts using an arbitrary integer
line parallel to the OX or OY axis. The player
making the move chooses which piece of the plyatsok they eat, and which
one they pass to the other player for the next turn. The player who
cannot make a move (they are left with a polygon in the form of a
1x1 square) loses and goes to bake the next plyatsok. Who
wins under optimal play?
Input
The first line is given a single integer \(n\) — the number of vertices of the plyatsok. The next \(n\) lines are given 2 integers each: \(x_i\) and \(y_i\) — the coordinates of the \(i\)-th vertex. The vertices are given in counterclockwise order.
Output
In a single line, print the single word First if the
first player wins, or Second if the second player wins.
Constraints
\(4 \le n \le 100000\),
\(-10^6 \le x_i, y_i \le 10^6\).
Samples
| Input (stdin) | Output (stdout) |
|---|---|
| 4 0 0 1 0 1 1 0 1 | Second |
| Input (stdin) | Output (stdout) |
|---|---|
| 6 0 0 2 0 2 1 1 1 1 2 0 2 | First |
Submit a solution
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|