Incomplete Book
Time limit1sMemory limit512 MB
Given the first book takes k days and each later book takes twice the previous, count how many books finish by day d.
- Level
Easy2 of 10
- Topics
- Math, Simulation, Implementation
- Solved
- No attempts yet
Problem
An author is writing a series of novels. The first book took days, and the writing got slower with every book after that. To be precise, if the -th book took days, the -th book takes days.
The author dies days after starting the first book. A book counts as finished if the day it is completed is not later than day . What is the largest number of books the author can finish?
Input
One line holds two integers and separated by a space. is the number of days the first book takes (), and is the number of days between the start of the first book and the author's death ().
Output
Print the largest number of books the author can finish, on one line.