#B2095. Evaluation of White Blood Cell Count with a New Antibiotic

    ID: 11177 Type: Default 1000ms 256MiB

Evaluation of White Blood Cell Count with a New Antibiotic

Evaluation of White Blood Cell Count with a New Antibiotic

During treatment, a hospital collects (n) samples of white blood cell counts from a clinical case to analyze the effect of a new antibiotic. To reduce analysis error, one sample with the maximum value and one sample with the minimum value are removed from the (n) samples. The effective sample set, consisting of the remaining (n-2) samples ({x_1,x_2,\dots,x_{n-2}}), is used to calculate the average white blood cell count: [ \bar{x} = \frac{1}{n-2}\sum_{i=1}^{n-2} x_i ] Furthermore, the error is defined as the maximum absolute difference between each effective sample and the average: [ error = \max_{1\le i\le n-2} |x_i-\bar{x}| ] Your task is to write a program that computes and outputs the average and the error. The output must show both numbers with two decimal places.

inputFormat

The first line contains an integer (n (n \ge 3)), representing the number of samples. The second line contains (n) space-separated integers representing the white blood cell counts.

outputFormat

Output two numbers: the average white blood cell count and the corresponding error, separated by a space. Both numbers should be printed with two decimal places.

sample

5
10 20 30 40 50
30.00 10.00