#K39372. Mean of Sum Along Axis 0

    ID: 26406 Type: Default 1000ms 256MiB

Mean of Sum Along Axis 0

Mean of Sum Along Axis 0

Given a 2-D array (matrix) with dimensions \(N \times M\), your task is to compute the sum of each column (i.e. the sum along axis 0), and then calculate the mean of these column sums. In other words, let \(a_{ij}\) be the elements of the matrix, the column sum for column \(j\) is \(S_j = \sum_{i=1}^{N} a_{ij}\). The answer is the mean:

\(\text{mean} = \frac{\sum_{j=1}^{M} S_j}{M}\)

Round the result to two decimal places.

inputFormat

The first line contains two integers \(N\) and \(M\) separated by a space.

The next \(N\) lines each contain \(M\) integers separated by spaces representing the 2-D array.

outputFormat

Print the mean of the sum along the first axis (column sums) as a floating point number rounded to two decimal places.

## sample
3 3
1 2 3
4 5 6
7 8 9
15.00