問題一覧 > 通常問題

No.384 Cell Filling Game 2

レベル : / 実行時間制限 : 1ケース 1.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 237
作問者 : kzyKT
お気に入りにしたユーザー ProblemId : 397 / 自分の提出
問題文最終更新日: 2026-06-25 03:05:21
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 140 (順位表) の他の問題:

Problem Statement

There is a grid of $H$ rows $×W$ columns.
People numbered $1$ to $N$ take turns in order, starting with person $1$; on each turn, a person chooses any $1$ row or $1$ column that contains an empty cell and fills all of its cells.
After person $N$, the turn returns to person $1$.
The person who fills the last cell loses.
Each person acts so as not to lose.
Output $YES$ if person $K$ loses, and $NO$ if they do not lose.

Input

$H\ W\ N\ K$

Line $1$ contains $H, W, N, K$ separated by spaces.
$1 \le H,W \le 10^9$
$1 \le N \le 10^{18}$
$1 \le K \le N$

Output

Output $YES$ if person $K$ loses, and $NO$ if they do not lose.

Sample

Sample 1
Input
2 2 2 1
Output
YES

Sample 2
Input
1 2 2 1
Output
NO

Sample 3
Input
1 14 5 4
Output
YES

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