H. Ludo
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

wzj has invented a brand new Ludo game! This game comes with a huge board and a giant die.

wzj really enjoys this game, but he can never gather enough players to start a match. Other people think one full game takes far too much time, so no one wants to play with him.

He wants to prove that the game can end quickly if everyone plays with the optimal strategy. Unfortunately, he does not know how to calculate the exact number of turns.

Could you help him solve this problem?

The board has $$$n$$$ cells numbered from $$$1$$$ to $$$n$$$. Initially, wzj's piece is placed on cell $$$1$$$. There is an $$$m$$$-sided die. Each roll generates an integer chosen uniformly at random from $$$1$$$ to $$$m$$$.

In each turn, wzj first rolls the die. Let the result be $$$x$$$. After seeing $$$x$$$, he has two choices: move forward by $$$x$$$ steps, or skip the turn and stay in place.

  • If he chooses to stay, the position of the piece remains unchanged.
  • If he chooses to move $$$x$$$ steps. Suppose the current cell is $$$p$$$:
    • If $$$p + x \le n$$$, the piece moves to cell $$$p+x$$$.
    • If $$$p + x \gt n$$$, the piece will bounce back and land on cell $$$n - (p + x - n) = 2n - p - x$$$.

The goal is to reach cell $$$n$$$ as quickly as possible.

Under the optimal strategy (which minimizes the expected number of turns to reach cell $$$n$$$), calculate the expected number of turns needed for wzj to travel from cell $$$1$$$ to cell $$$n$$$.

Input

One line contains two positive integers $$$n, m$$$ ($$$2 \le n \le 10^5$$$, $$$1 \le m \lt n$$$), representing the total number of cells and the number of faces of the die.

Output

Print a single real number, which is the expected number of turns under the optimal strategy. Your answer is considered correct if the absolute error or relative error between your output and the standard answer is no more than $$$10^{-6}$$$.

Examples
Input
8 6
Output
7.0000000000
Input
4 2
Output
3.0000000000
Input
5 2
Output
3.5000000000
Input
100 6
Output
33.0476190476