At the start of the matrix game, we have an N x M matrix. Each grid has some balls.In each operation you can remove one ball from a grid or add one ball into a grid.The goal of this game is to make each of the rows has the same number of balls and each of the columns has the same number of balls.What is the minumun operations you should use?
At the start of the matrix game, we have an N x M matrix. Each grid has some balls. The grid in (i,j) (0 ≤ i < N, 0 ≤ j < M) has Aij balls. In each operation you can remove one ball from a grid or add one ball into a grid. The goal of this game is to make each of the rows has the same number of balls and each of the columns has the same number of balls. What is the minumun operations you should use?
(图片来源网络,侵删)