Time limit
2s
Memory limit
256 MB
Processing integers is an important task in statistics. Given an odd number N of integers, compute the following four basic statistics.
Write a program that prints these four values for the given numbers, in order.
The first line contains the number of values N. (1≤N≤500000)
N is odd. Each of the next N lines contains one integer. The absolute value of every integer is at most 4000.
On the first line, print the arithmetic mean, rounded to the nearest integer.
On the second line, print the median.
On the third line, print the mode. If there are multiple modes, print the second smallest one.
On the fourth line, print the range.