#K67747. Sum of Column Means

    ID: 32711 Type: Default 1000ms 256MiB

Sum of Column Means

Sum of Column Means

Given an ( n \times m ) matrix ( A ), your task is to compute the mean of each column and then output the sum of these means. Formally, for each column ( j ) (( 1 \le j \le m )), compute ( \text{mean}j = \frac{1}{n}\sum{i=1}^{n} A_{ij} ) and then find ( S = \sum_{j=1}^{m} \text{mean}_j ). You need to read the matrix from stdin and print the result to stdout. The input guarantees that ( n ) and ( m ) are positive integers. Note that the answer can be a decimal value.

inputFormat

The first line contains two integers ( n ) and ( m ) separated by a space, representing the number of rows and columns of the matrix. This is followed by ( n ) lines, each containing ( m ) space-separated integers. These integers represent the rows of the matrix.

outputFormat

Output a single floating-point number which is the sum of the mean of each column. The result should be printed to stdout.## sample

4 3
1 2 3
4 5 6
7 8 9
10 11 12
19.5