Rocket Time Travel - B

0

0 votes
Easy
Problem

After the Avengers war, Rocket misses groot, so he decides to make a time travelling device to save groot.
The device is created in a finite number of steps. Each step takes some amount of fusion energy and gives back some of this energy as drift energy.
effective Power = total fusion energy - total drift energy

fusion energy for first step is 2 and gets quadrupled in every next step, i.e. 8 for second, 32 for third step ans so on. 

drift energy of a step is  drift_factor_of_the_step * Log(fusion_energy_of_that_step). 

Initially, drift factor is 1 and gets doubled in every next step, i.e. 2 for second, 4 for third step and so on.
Help Rocket find minimum number of steps such that effective Power spent is at least 300000000000000000.

 

NOTE You do not need to create a program for this problem you have to write your answers of given input in given code snippet

  • To see how to submit solution please check this link.

Compile and Test can give Wrong Answer. Once you have written your answer, press Submit button to check your result.

Sample Input
100
Sample Output
5
Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

Fusion energy is 2, 8, 32, 128, 512 for first 5 steps. So, total Fusion energy is 682.
Drift energy is 1, 6, 20, 56, 144 for first 5 steps. So, total drift energy is 227.
Total amount of effective Power is 682 - 227 = 455, which is greater than 100

It can be proved that total amount of effective Power will be less than 100 for number of steps <= 4.

Editor Image

?