DWITE '02 R2 #2 - The Five M's of Stats 101

View as PDF

Submit solution

Points: 5
Time limit: 0.6s
Memory limit: 32M

Problem type
DWITE Online Computer Programming Contest, November 2002, Problem 2

Five commonly reported statistic figures (that notably start with the letter m) include the:

  1. mean
  2. median
  3. mode
  4. maximum
  5. minimum

Your job is the calculate these five figures from a given set of values.

Input Specification

The first line of the input will contain the integer n (0 < n \le 1\,000), which represents the number of values in the set. The next n lines will contain the real values (-1\,000 \le \text{value} \le 1\,000) of the set, each on a separate line.

Output Specification

The output will contain five lines of data, each representing the statistic figure, listed in the order above. Each figure should be rounded to two decimal places, left-justified.
Note: There will be only one mode in the set of values.

Sample Input

10
1
2
3
4.5
3
6
7.5
8
9
10

Sample Output

5.40
5.25
3.00
10.00
1.00

Comments

There are no comments at the moment.