codeforces-scrape

Codeforces scraped problems and editorials
git clone git://git.laack.co/codeforces-scrape.git
Log | Files | Refs | README

799A.md (2276B)


      1 Source: https://codeforces.com/problemset/problem/799/A
      2 
      3 A. Carrot Cakes
      4 
      5 time limit per test
      6 
      7 1 second
      8 
      9 memory limit per test
     10 
     11 256 megabytes
     12 
     13 input
     14 
     15 standard input
     16 
     17 output
     18 
     19 standard output
     20 
     21 In some game by Playrix it takes *t* minutes for an oven to bake *k* carrot cakes, all cakes are ready at the same moment *t* minutes after they started baking. Arkady needs at least *n* 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 *d* 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.
     22 
     23 Determine if it is reasonable to build the second oven, i.e. will it decrease the minimum time needed to get *n* cakes or not. If the time needed with the second oven is the same as with one oven, then it is unreasonable.
     24 
     25 Input
     26 
     27 The only line contains four integers *n*, *t*, *k*, *d* (1 ≤ *n*, *t*, *k*, *d* ≤ 1 000) — the number of cakes needed, the time needed for one oven to bake *k* cakes, the number of cakes baked at the same time, the time needed to build the second oven.
     28 
     29 Output
     30 
     31 If it is reasonable to build the second oven, print "YES". Otherwise print "NO".
     32 
     33 Examples
     34 
     35 Input
     36 
     37 ```
     38 8 6 4 5
     39 ```
     40 
     41 Output
     42 
     43 ```
     44 YES
     45 ```
     46 
     47 Input
     48 
     49 ```
     50 8 6 4 6
     51 ```
     52 
     53 Output
     54 
     55 ```
     56 NO
     57 ```
     58 
     59 Input
     60 
     61 ```
     62 10 3 11 4
     63 ```
     64 
     65 Output
     66 
     67 ```
     68 NO
     69 ```
     70 
     71 Input
     72 
     73 ```
     74 4 2 1 4
     75 ```
     76 
     77 Output
     78 
     79 ```
     80 YES
     81 ```
     82 
     83 Note
     84 
     85 In the first example it is possible to get 8 cakes in 12 minutes using one oven. The second oven can be built in 5 minutes, so after 6 minutes the first oven bakes 4 cakes, the second oven bakes 4 more ovens after 11 minutes. Thus, it is reasonable to build the second oven.
     86 
     87 In the second example it doesn't matter whether we build the second oven or not, thus it takes 12 minutes to bake 8 cakes in both cases. Thus, it is unreasonable to build the second oven.
     88 
     89 In the third example the first oven bakes 11 cakes in 3 minutes, that is more than needed 10. 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.