Problem I
Boiling Vegetables
The trick to boiling vegetables is to make sure all pieces
are about the same size. If they are not, the small ones get
too soft or the large ones get undercooked (or both).
Fortunately, you have heard of the kitchen knife, but your
parents’ warnings of using sharp instruments still echoes in
your head. Therefore you better use it as little as possible.
You can take a piece of a vegetable of weight
Input
The input starts with a floating point number
Output
Output the minimum number of cuts needed to make the ratio
between the resulting minimum weight piece and the resulting
maximum weight piece be above
To avoid issues with floating point numbers, you can assume
that the optimal answer for ratio
Sample Input 1 | Sample Output 1 |
---|---|
0.99 3 2000 3000 4000 |
6 |
Sample Input 2 | Sample Output 2 |
---|---|
0.80 2 1000 1400 |
3 |