#K41837. Maximal Bonus Distribution
Maximal Bonus Distribution
Maximal Bonus Distribution
You are given n employees with their performance scores and a number k. Your task is to determine the maximum bonus distribution among the top performers. In particular, the bonus distribution is defined as the number of employees whose performance score is greater than or equal to the kth highest score.
Formally, let \( S = [s_1, s_2, \dots, s_n] \) be the list of performance scores. If \(s_{(k)}\) is the kth highest score when \(S\) is sorted in non-increasing order, then the bonus distribution is computed as:
\[ bonus = \#\{ s \in S : s \geq s_{(k)} \} \]Output the bonus as a floating point number with one digit after the decimal point.
inputFormat
The input is read from standard input (stdin) and consists of two lines:
- The first line contains two space-separated integers: n (the number of employees) and k (the number of top performers for bonus consideration).
- The second line contains n space-separated integers representing the performance scores of the employees.
outputFormat
Print a single floating point number (with one decimal precision) representing the maximum bonus distribution. This number is the count of employees with a performance score greater than or equal to the kth highest score.
## sample8 3
70 80 80 90 70 60 90 85
3.0
</p>