問題一覧 > 通常問題

No.3475 Many Hello Substrings

レベル : / AI推定難易度 : 1400 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 1024 MB / 標準ジャッジ問題
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 59
作問者 : 👑 AngrySadEight / テスター : 👑 p-adic
お気に入りにしたユーザー ProblemId : 13184 / 自分の提出
問題文最終更新日: 2026-03-20 07:12:55
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 494 オムニバス (順位表) の他の問題:

Problem Statement

Determine whether there exists a string $S$ satisfying all of the following conditions.

  • $S$ is a string of length $N$ consisting of lowercase English letters.
  • Let $T$ be the string obtained by concatenating $P$ copies of $S$. Then, $T$ contains exactly $K$ distinct occurrences of hello as a substring.

You are given $T$ test cases; answer each of them.

Constraints

  • All input values are integers
  • $1 \leq T \leq 10^3$
  • $1 \leq N \leq 10^8$
  • $1 \leq P \leq 10^8$
  • $0 \leq K \leq NP$

Input

The input is given from standard input in the following format. Here, $\mathrm{case}_i (1 \leq i \leq T)$ denotes the $i$-th test case.

$T$
$\mathrm{case}_1$
$\mathrm{case}_2$
$\vdots$
$\mathrm{case}_T$

Each case is given in the following format.

$N$ $P$ $K$

Output

Print $T$ lines. On the $i$-th line, print Yes if there exists a string $S$ satisfying the conditions in the $i$-th test case, and No otherwise.

Sample

Sample 1
Input
4
7 3 3
1 5 1
10 5 3
100 100 1000
Output
Yes
No
No
Yes

For the $1$-st test case, if $S$ is helloab, for example, then $T$ is helloabhelloabhelloab. Since $T$ contains exactly $3$ occurrences of hello as a substring, the conditions are satisfied.

For the $2$-nd test case, no string $S$ satisfying the conditions exists. For example, if $S$ is a, then $T$ is aaaaa, but $T$ does not contain hello as a substring.

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