题目描述
Problem Description
You are facing a challenge from $n$ participants, and you need to defeat them all. In each round, some participants are eliminated; you will receive a portion of the prize pool equal to the number of eliminated participants divided by the total number of opponents in that round.
For example, if there are 10 opponents in a round and 3 are eliminated, you will receive 3/10 of the prize pool.
Assuming the prize pool for each round is one unit of currency, Mirko wants to win the competition in exactly $k$ rounds. What is the maximum amount of prize money he can possibly earn?
You only need to output the answer rounded to 9 decimal places.
Input Format
A single line containing two positive integers $n$ and $k$.
Output Format
Output a single floating-point number representing the answer.
Sample Input and Output
Sample Input #1
5 3
Sample Output #1
2.100000000
Sample Input #2
10 10
Sample Output #2
2.928968254
Notes/Hints
Sample 1 Explanation:
The optimal scenario is:
- In the first round, 3 participants are eliminated.
- In the next two rounds, 1 participant is eliminated each.
- The total prize money earned is $\frac{3}{5} + \frac{1}{2} + \frac{1}{1} = 2.1$ units.
Data Range:
- For 20% of the data, $1 \le n \le 100$.
- For 40% of the data, $1 \le n \le 3000$.
- For 100% of the data, $1 \le k \le n \le 10^5$.
This problem is sensitive to precision, so please be cautious.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分