Solve the problem of summation the columns by rows