DotA Quals
Today, instead of studying for the coming exams, a student with a nickname "Idned" has decided to take part in an open qualification for a huge DotA (Development of the Algorithms) tournament. The qualification is going to be a single-elimination tournament with 2n participants, and Idned is one of them. There will be n rounds in total. All other remaining participants will be randomly divided into pairs for each round with equal chances for any possible division. In each pair, the participants will play against each other, and the loser will quit the tournament (and will not participate in the further rounds).
Each participant has a unique rating, and Idned's rating is k-th highest. Idned is sure that the outcome of each game is fully determined by the ratings of two participants, and whoever has a higher rating will win. Using this assumption, can you determine the expected number of rounds in which Idned will take part?
Input
Contains two integers n and k (1 ≤ n ≤ 10, 1 ≤ k ≤ 2n): the total number of rounds and Idned's position in the overall rating.
Output
Output the expected number of rounds.
Your answer must be correct to within an absolute or relative error of 10^(-9)
. Formally, let your answerbe a, and the jury's answer be b. Your answer will be considered correct if |a - b| / max(1, |b|) ≤ 10^(-9)
.