2357: Median Number
Result | TIME Limit | MEMORY Limit | Run Times | AC Times | JUDGE |
---|---|---|---|---|---|
3s | 8192K | 1536 | 657 | Standard |
Given a series of integers, calculate the median value. If there are two median values, output the average of the two median values.
Input
The input contains multi-cases. The first line of each case contains N (N<=100) which is the number of the integers, and followed by N integers. N equals zero means the end of the input.
Output
For each test case, you should print the value.
Sample Input
3 2 8 6 4 1 3 4 9 0
Sample Output
6 3.5
Problem Source: 1st Jilin Province Contest, skywind
This problem is used for contest: 63 145 157
Submit / Problem List / Status / Discuss