eolymp
bolt
Try our new interface for solving problems
Problems

The average number of Masha

The average number of Masha

When Mary met with the numbers, she began to write a sprig on the sand arbitrary sequence of \textbf{n} numbers, then in my mind to sort them in ascending order, and in the resulting sequence to look for the number of standing in the middle. If standing in the middle of the numbers were two, Maria just took a mean number average of the two averages. \InputFile The input data contain several test cases. Each test case starts with a line containing the value of numbers in a regular sequence of \textbf{n} (\textbf{0} ≤ \textbf{n} ≤ \textbf{100}). This is followed by \textbf{n} lines containing the numbers themselves (the numbers do not exceed the modulo \textbf{10^5}). A string containing the \textbf{n} = \textbf{0}, is a signal that the end of the input data and is not processed. \OutputFile For each test case on a separate line, an exact value of the desired average number of Masha.
Time limit 1 second
Memory limit 64 MiB
Input example #1
3
2
8
6
4
1
3
4
9
0
Output example #1
6
3.5
Source Team Cup Ukraine 2011 - schoolchildren - Round 1