Problem C
Koffínhraði
Languages
en
is
Oh no! Now towards the end of the term there are all kinds of exams and final projects closing in! By your side you of course have your trusty stash of caffeinated drinks. Tea, coffee, energy drinks and more can help you cover all the material and finish all the projects in the time you have. Such drinks are however far from free, so now the question is how deep you have to dip into your stash to get everything done in time.
Each drink halves the number of hours a task will take,
rounded down to the nearest whole number of hours. Two drinks
will thus half the hours in this manner twice. For example a
Each exam or project has a deadline and has to be finished by that date. Everything is given in hours and we of course assume there will be no sleep or other distractions from working on studies.
Input
The first line of input contains a single positive integer
Output
Print the minimum number of caffeinated drinks it will take to finish everything in time. You may assume that all tasks can be finished in time given enough caffeine. Note that this is not true to real life.
Scoring
Group |
Points |
Constraints |
1 |
20 |
|
2 |
20 |
All |
3 |
20 |
All |
4 |
20 |
|
5 |
20 |
|
Sample Input 1 | Sample Output 1 |
---|---|
4 5 10 8 10 10 21 15 21 |
3 |