#K86127. Calculate Contribution
Calculate Contribution
Calculate Contribution
You are given a list of integers that represent contributions from participants. Your task is to calculate the following:
- Total amount collected, denoted by \(T\).
- Average contribution, denoted by \(A\), computed as the floor division \(A = \lfloor \frac{T}{n} \rfloor\) where \(n\) is the number of participants.
- The number of participants whose contribution is strictly greater than \(A\).
Input will be provided via standard input (stdin) and the results should be written to standard output (stdout) in the format: T A count
, where each value is separated by a single space.
inputFormat
The first line of the input contains an integer \(n\) representing the number of participants. The second line contains \(n\) space-separated integers, each representing a participant's contribution.
For example:
4 50 100 150 200
outputFormat
The output should consist of three integers on one line separated by spaces:
- The total sum of contributions.
- The average contribution (using floor division).
- The count of participants whose contribution is greater than the average.
For the above sample, the output should be:
500 125 2## sample
4
50 100 150 200
500 125 2
</p>