#P5308. [COCI 2018/2019 #4] Akvizna

[COCI 2018/2019 #4] Akvizna

Problem Description

You are facing a challenge from nn contestants, and in the end you must defeat all of them.
In each round, some contestants are eliminated. You will receive a share of the prize pool for that round equal to the ratio $\dfrac{\text{number eliminated in this round}}{\text{total number of opponents in this round}}$.

For example, if there are 1010 opponents in a round and 33 are eliminated, then you will receive 310\dfrac{3}{10} of the prize pool.

Assume the prize pool in every round is 1 unit of money. Mirko wants to win the competition in exactly kk rounds. What is the maximum total prize he can get?

You only need to output the answer rounded to 99 decimal places.

Input Format

One line with two positive integers n,kn,k.

Output Format

Output one line with one real number representing the answer.

5 3
2.100000000
10 10
2.928968254

Hint

Explanation of Sample 1:

The best situation is:
Eliminate 33 people in the first round, and eliminate 11 person in each of the remaining two rounds.
The total prize is 35+12+11=2.1\frac{3}{5}+\frac{1}{2}+\frac{1}{1}=2.1.

Constraints:

For 20%20\% of the testdata, 1n1001\le n\le 100.

For 40%40\% of the testdata, 1n30001\le n \le 3000.

For 100%100\% of the testdata, 1kn1051\le k \le n \le 10^5.

This problem is quite strict about precision. Please be careful.

Translated by ChatGPT 5