Statistics

No attempts yetTime limit1sMemory limit128 MB

Problem

The cows have enrolled in an elementary statistics class and are struggling with their homework. Please help them.

You are given a set of $N$ integers $X_i$ ($1 \le N \le 500$, $-5000 \le X_i \le 5000$). Compute the following two statistics:

  • Mean: the sum of the numbers divided by $N$.
  • Median: if $N$ is odd, the middle number after sorting the $N$ numbers; if $N$ is even, the average of the two middle numbers after sorting.

Print each statistic rounded to exactly six digits after the decimal point.

Input

  • Line 1: the integer $N$.
  • Lines 2 through $N+1$: line $i+1$ contains a single integer $X_i$.

Output

  • Line 1: the mean of the input set, printed with exactly six digits after the decimal point.
  • Line 2: the median of the input set, printed with exactly six digits after the decimal point.

Hint

For the set ${2, 4, 6, 8, 12}$, the mean is $(12+4+6+8+2)/5 = 6.4$, and because there are five numbers, the median is the middle value after sorting, which is $6$.