10305 - Lab9_2   

Description

Find the median from an unsorted list.

Note that if a < b < c, then the median of the list {a, b, c} is b, and, if a < b < c < d, then the median of the list {a, b, c, d} is the mean of b and c; i.e., it is (b + c)/2.

 

You can use the bubble sort first and then find the median from the sorted list.

Input

The input contains two lines.

The first line contains an integer N (0

The second line contains a list of the values of the N elements, which are separated by blanks.

Output

Print the median of the list of the input. The answer should be expressed as a floating point number with precision to the first decimal place. For example, 4.0 or 6.5.

Be sure to add a newline character '\n' at the end.

Sample Input  Download

Sample Output  Download

Tags




Discuss