#K79687. Calculate the Mean of a List of Numbers

    ID: 35364 Type: Default 1000ms 256MiB

Calculate the Mean of a List of Numbers

Calculate the Mean of a List of Numbers

Your task is to calculate the arithmetic mean of a list of numbers and output the result rounded to 4 decimal places.

If the list is empty (i.e. the number of elements N is 0), print 0.0000.

Note: The mean is defined as \(\frac{1}{N}\sum_{i=1}^{N} a_i\) when \(N > 0\), and rounding should be performed so that exactly 4 digits appear after the decimal point.

inputFormat

The input is read from standard input and consists of two parts:

  • The first line contains an integer \(N\), representing the number of elements in the list.
  • If \(N > 0\), the second line contains \(N\) space-separated integers.

outputFormat

Output the mean of the list rounded to 4 decimal places on a single line. If \(N = 0\), output 0.0000.

## sample
5
1 2 3 4 5
3.0000