CF799A.Carrot Cakes

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

In some game by Playrix it takes tt minutes for an oven to bake kk carrot cakes, all cakes are ready at the same moment tt minutes after they started baking. Arkady needs at least nn cakes to complete a task, but he currently don't have any. However, he has infinitely many ingredients and one oven. Moreover, Arkady can build one more similar oven to make the process faster, it would take dd minutes to build the oven. While the new oven is being built, only old one can bake cakes, after the new oven is built, both ovens bake simultaneously. Arkady can't build more than one oven.

Determine if it is reasonable to build the second oven, i.e. will it decrease the minimum time needed to get nn cakes or not. If the time needed with the second oven is the same as with one oven, then it is unreasonable.

输入格式

The only line contains four integers nn , tt , kk , dd ( 1<=n,t,k,d<=10001<=n,t,k,d<=1000 ) — the number of cakes needed, the time needed for one oven to bake kk cakes, the number of cakes baked at the same time, the time needed to build the second oven.

输出格式

If it is reasonable to build the second oven, print "YES". Otherwise print "NO".

输入输出样例

  • 输入#1

    8 6 4 5
    

    输出#1

    YES
    
  • 输入#2

    8 6 4 6
    

    输出#2

    NO
    
  • 输入#3

    10 3 11 4
    

    输出#3

    NO
    
  • 输入#4

    4 2 1 4
    

    输出#4

    YES
    

说明/提示

In the first example it is possible to get 88 cakes in 1212 minutes using one oven. The second oven can be built in 55 minutes, so after 66 minutes the first oven bakes 44 cakes, the second oven bakes 44 more ovens after 1111 minutes. Thus, it is reasonable to build the second oven.

In the second example it doesn't matter whether we build the second oven or not, thus it takes 1212 minutes to bake 88 cakes in both cases. Thus, it is unreasonable to build the second oven.

In the third example the first oven bakes 1111 cakes in 33 minutes, that is more than needed 1010 . It is unreasonable to build the second oven, because its building takes more time that baking the needed number of cakes using the only oven.

首页