Page not loading? Try clicking here.
Placeholder

#1004

sum, avg, and stddev 1s 32MB

Problems

Cheol-gi, the accountant at a lunchbox restaurant, is tasked with compiling the prices of food items ordered by customers and calculating the total price, average price, and standard deviation. He initially calculates these prices manually at the end of each workday, but the daily fluctuations in the number of lunchboxes and prices complicate things, leading him to consider creating a program to do so.

The mean and standard deviation are rounded to the first decimal place. The formula for the standard deviation, where Xi is the price of each lunchbox and M is the mean, is as follows:

S = \sqrt{s^2} = \sqrt{{(X_1 - M)^2 + (X_2 - M)^2 + (X_3 - M)^2 +...}\over{N}}

Standard deviation is a numerical value that indicates the degree of dispersion of data. It is the square root of the amount of dispersion, and a small standard deviation indicates a small degree of dispersion around the mean.


Input

The first line contains the number of lunch boxes, n (an integer between 1 and 100), and the next n lines contain the prices of each lunch box (an integer between 1,000 and 4,000).

The program terminates when one result is output. Data whose size exceeds the given range is not input.


Output

Based on the data entered above, the total sum, average price, and standard deviation of the lunch box prices should be printed.

The mean and standard deviation are rounded to the second decimal place and output to the first decimal place.

However, if the first decimal place of the rounded value is 0, it should not be printed.


Example

3

1500
2000
2500
6000

2000
408.2

Source

JUNGOL

You must sign in to write code.