#P5308. [COCI 2018/2019 #4] Akvizna
[COCI 2018/2019 #4] Akvizna
Problem Description
You are facing a challenge from 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 opponents in a round and are eliminated, then you will receive of the prize pool.
Assume the prize pool in every round is 1 unit of money. Mirko wants to win the competition in exactly rounds. What is the maximum total prize he can get?
You only need to output the answer rounded to decimal places.
Input Format
One line with two positive integers .
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 people in the first round, and eliminate person in each of the remaining two rounds.
The total prize is .
Constraints:
For of the testdata, .
For of the testdata, .
For of the testdata, .
This problem is quite strict about precision. Please be careful.
Translated by ChatGPT 5