408630: GYM103241 E Calculating Costs
Description
Cameron is a cashier for a store and at the end of the day, Cameron wrote down the money he got from each customer throughout the day. His manager wants the mean, median, and mode of the list of money from each customer. The manager wants all numbers to be rounded down to the nearest integer, and if there are multiple modes, then the manager wants the largest mode. If the number of customers that day was even, then the manager wants the median to be the average of the two middle numbers, rounded down.
InputThe first line has an integer $$$1 < N \leq 1000$$$, representing the number of customers throughout the day.
The second line has $$$N$$$ space-separated integers, $$$1 \leq K \leq 1000$$$, where $$$K$$$ represents each space-separated integer.
OutputPrint the mean, median, and mode of the list of numbers in that order, each on a separate line, rounding down to the nearest integer.
ExampleInput5 3 7 5 18 7Output
8 7 7Note
Problem idea: Spark
Problem preparation: Spark
Occurances: Novice 5