## MWC '15 #5 P1: Stats

View as PDF

Points: 5
Time limit: 2.0s
Memory limit: 256M

Author:
Problem types

You have just finished your edge case test in ICS. Since you are an exceptional student, your teacher has given you an extra assignment:

Find the mean, median and mode of all the test scores.

Since it's absurd to do this manually, you have burdened yourself with creating a computer program!

The mean is an average (total score divided by number of tests). The median is the middle score, or the average of the two middle scores if there is an even number of tests. The mode is the score that occurs most often. If multiple scores occur most often, then all of them are considered modes.

#### Input Specification

The first line will contain a single integer , the number of tests.

The second line will contain numbers, , the score that th person received, as a percent rounded to the nearest tenth.

#### Output Specification

Three lines in the following order:

• The mean of all the test scores
• The median of all the test scores
• The mode(s) of all the test scores in ascending order

Output will be accepted within a margin of error of .

#### Sample Input

5
50 60 70 50 70

#### Sample Output

60
60
50 70

#### Explanation for Sample Output

Everyone got rekt by the edge case test, so the average was . The median is also 60. The modes: and both occurred the most with 2 times.