Cyclopian Cash

View as PDF

Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 16M

Author:
Problem type
PEG 11/12 Programming Test 1 - October 19

Alas, FurWear has failed to turn a profit from the mysterious land of Cyclopia. Upon realising that giants can wear clothing in larger sizes but not in smaller sizes, FurWear has decided to produce clothing sized according to the median of all the sizes, so as to fit approximately half the population. (Having clothing that fits the entire population would hardly make FurWear exclusive!)
Write a program to correct this silly oversight.

Input Specification

The first line consists of a single integer N (1 \le N \le 1\,000), the number of Oelfinn. The following N lines each contain a single integer a_{i} (10 \le a_{i} \le 1\,000), the size of clothing worn by the ith Oelfinn.

Output Specification

Output on a single line the median of all the sizes, to one decimal place.

Sample Input

6
28
49
18
40
69
37

Sample Output

38.5

Comments

There are no comments at the moment.