#K33802. Minimum Total Bonus
Minimum Total Bonus
Minimum Total Bonus
You are given an integer n
which represents the number of employees and a list of n
integers representing their ranks. Although the ranks are provided, the bonus distribution is independent of the rank values. Your task is to compute the minimum total bonus points if you assign bonus points to the employees as the first n
natural numbers.
The total bonus is given by the formula:
\( \frac{n(n+1)}{2} \)
Read the input from stdin and print the result to stdout.
inputFormat
The first line of input is a single integer n
, the number of employees. The second line contains n
space-separated integers representing the ranks of the employees.
outputFormat
Output a single integer representing the minimum total bonus, which is the sum of the first n
natural numbers.
5
3 3 1 2 1
15