Task 3: Cave Troll
Task 3: Cave Troll
In Trollville, trolls live happily. These trolls are different from your average forum trolls, these are CAVE trolls. Cave trolls need food to live. In the middle of Trollville there is a 1 metre tree which produces food every day based on its size. More precisely, the tree will hold 1kg of food for each metre in height. The tree doubles in height every day. The trolls want to have a feast which needs a certain amount food, so they won't eat anything from the treee until they have enough. Make a program that calculates the number of days the trolls have to wait to have enough food.
Example:
Input:
Food required (kg): 5
Output:
3
Input:
Food Required (kg) 1025
Output:
11
Example:
Input:
Food required (kg): 5
Output:
3
Input:
Food Required (kg) 1025
Output:
11
Similar topics
» Task 5: As easy as bagels
» Task 2: Lightposts
» Task 4: MasterCoder
» Task 6: The cake is a lie!
» Task 1: Rectangle Area
» Task 2: Lightposts
» Task 4: MasterCoder
» Task 6: The cake is a lie!
» Task 1: Rectangle Area
Permissions in this forum:
You cannot reply to topics in this forum