题号:NC24962
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 32 M,其他语言64 M
Special Judge, 64bit IO Format: %lld
题目描述
The cows have enrolled in elementary statistics and are having a tough time with their homework. Please help them.
Given a set of N (1 <= N <= 500) numbers, Xi (-5,000 <= Xi <= 5000),
calculate two statistics:
* The mean (sum of the numbers divided by N)
* The median (if N is odd, the middle number when the N numbers are sorted; if N is even, the mean of the two middle numbers when the N numbers are sorted)
Your answer will be considered correct if it is within 0.002 of the official answer.
输入描述:
* Line 1: A single integer: N
* Lines 2..N+1: Line i+1 contains a single integer: Xi
输出描述:
* Line 1: The mean of the input set
* Line 2: The median of the input set