cho.sh
Notes
Loading...

Code Collection

Time limit

2s

Memory limit

256 MB

Problem

There are N different codes. Each time a code is obtained, every one of the N codes is equally likely, independently of previous draws. The same code may appear multiple times.

A programmer can identify the hidden location as soon as K different codes have been collected. Find the expected number of code draws needed to collect at least K distinct codes.

Input

The first line contains two natural numbers N and K.

1 <= N <= 10^18 and 1 <= K <= N.

Output

Print the answer. An absolute or relative error of at most 10^-9 is accepted.