QOJ.ac

QOJ

実行時間制限: 1 s メモリ制限: 256 MB 満点: 100

#10939. 战斗

統計

一个怪物入侵了 Erathia 王国,著名的英雄 Solmyr 想要杀死它。 怪物初始有 $h$ 点生命值(HP)。如果生命值小于 1,怪物就会死亡。 Solmyr 和怪物轮流行动。在每一轮中,Solmyr 可以攻击怪物,使怪物的生命值减少 $a$。在该轮结束时,怪物的生命值会增加 $b$。 在连续攻击 $k$ 轮后,Solmyr 在这一轮必须休息。此外,他也可以选择在任意一轮休息。 如果 Solmyr 能杀死这个怪物,输出 “YES”,否则输出 “NO”。

输入格式

输入包含不超过 450 组测试数据,以一行四个零作为结束。 对于每组测试数据,第一行包含四个整数 $h, a, b, k$ ($1 \le h, a, b, k \le 10^9$)。

输出格式

对于每组测试数据,如果 Solmyr 能杀死这个怪物,输出 “YES”,否则输出 “NO”。

样例

样例输入 1

5 3 2 2
0 0 0 0

样例输出 1

NO

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.