calculate the average of the sum of the elements in a row testing