問題一覧 > 通常問題

No.726 Tree Game

レベル : / AI推定難易度 : 1350 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 134
作問者 : treeone / テスター : Lemma299 polylogK
お気に入りにしたユーザー ProblemId : 2215 / 自分の提出
問題文最終更新日: 2018-08-24 21:59:46
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 198 (順位表) の他の問題:

Problem Statement

There is a grid with $10^{1333}\ $ rows and $10^{1333}\ $ columns, and 1 tree.
The cell in row $i\ (1 ≦ i ≦ 10^{1333}\ )$ and column $j\ (1 ≦ j ≦ 10^{1333}\ )$ is called cell $(i, j)$. Here, the bottom-left cell is cell $(1, 1)$ and the top-right cell is cell $(10^{1333}\ , 10^{1333}\ )$.
Also, cell $(i, j)$ is called a prime cell if $i$ or $j$ is a prime number.
Using this grid and the tree, $2$ players play the following game.

Initially, the tree is growing on cell $(Y, X)$.
On their turn, a player must move the tree to the cell $1$ above or $1$ to the right.
That is, if the tree is currently growing on cell $(Y, X)$, the player must move the tree to cell $(Y + 1, X)$ or cell $(Y, X + 1)$.
The players take turns alternately, and the player who moves the tree to a prime cell loses. (The other player wins.)
Note that if a player cannot move within the bounds, the player who cannot move loses.

Given positive integers $Y, X$, determine which of the first player and the second player wins when both players play optimally.

Input

$Y\ X$

Positive integers $Y, X$ are given, separated by a space.
They satisfy $1 \leqq Y, X \leqq 10^9$.

Output

Print First if the first player wins, and Second if the second player wins. Print a newline at the end.

Sample

Sample 1
Input
22 16
Output
Second

The first player can move the tree to cell $(23, 16)$ or cell $(22, 17)$, but both are prime cells, so the second player wins.

Sample 2
Input
59 56
Output
First

The initial position may be a prime cell. (The player who moves the tree to a prime cell loses.)

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。