Guess the Number
Bob and his older brother Albert enjoy playing a game called "Guess the Number." In this game, Bob picks a number K within the range from 1 to N. Albert then tries to guess the number by suggesting different numbers, while Bob provides feedback indicating whether the guessed number is higher, lower, or correct. Albert follows a specific strategy to make his guesses:
1. Albert starts by setting A to 1 and B to N. 2. He calculates M, which is the integer part of the average of A and B. 3. Albert guesses the number M. 4. If Bob responds with "Less," Albert updates A to M + 1 and repeats step 2. 5. If Bob responds with "More," Albert updates B to M - 1 and repeats step 2. 6. If Bob responds with "Guessed," the game concludes.
For instance, consider N = 9 and Bob's chosen number K = 6. Initially, A = 1 and B = 9. Albert guesses 5 and Bob says "Less." Albert then sets A = 6 and B = 9. On his next guess, Albert chooses 7, and Bob replies "More." Now, A = 6 and B = 6. Albert guesses 6 and Bob says "Guessed."
Your task is to write a program that calculates how many guesses Albert will make before Bob confirms with "Guessed."
Input
The input consists of a single line containing two integers N (1 ≤ N ≤ 1000) and K (1 ≤ K ≤ N), separated by a space.
Output
Output a single integer representing the number of guesses Albert makes until Bob responds with "Guessed."