Nathan is preparing for the Dash marathon. He has
training plans. The -th plan has an effectiveness of , but requires that at leastother training plans must be performed before it. A training plan cannot be repeated.
If he performs some
distinct trainings - then his training score is . If Nathan does not perform any training plan , then his score is.
What is the highest score that Nathan can get by performing zero or more training plans, if he can perform them in any order?
Input Format
- The first line of the input contains a single integer
- -th training plan.
Output Format
- For each test case, output a single real number - the highest score that Nathan can get by performing zero or more training plans.
- Your answer is considered correct if its absolute or relative error does not exceed
- .
Constraints
- .
Sample Input 1
3
4
-9 -21 -4 -43
0 0 0 0
5
10 14 5 9 1
4 1 3 0 0
7
-1 101 5 63 -7 -88 59
0 1 6 2 3 4 5
Sample Output 1
0.000000
11.500000
54.333333
Explanation
Test case 1: It is optimal for Nathan to not perform any training plans as all the plans have negative
value.
Test case 2: It is optimal for Nathan to:
- First, perform the
- training plan)
Test case 3: It is optimal for Nathan to:
- First, perform the
ConversionConversion EmoticonEmoticon