eolymp
bolt
Try our new interface for solving problems
Problems

DotA Quals

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 (1n10, 1k2n): 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 answer be a, and the jury's answer be b. Your answer will be considered correct if |a - b| / max(1, |b|) ≤ 10-9.

Time limit 1 second
Memory limit 128 MiB
Input example #1
2 2
Output example #1
1.666666666667
Input example #2
3 5
Output example #2
1.457142857143
Source 2018 Petrozavodsk, Winter, ITMO, Contest 1, January 31, Problem D