{"raw_statement":[{"iden":"problem statement","content":"We have a grid with $H$ horizontal rows and $W$ vertical columns. The square at the $i$\\-th row from the top and $j$\\-th column from the left has $A_{i, j}$ blocks stacked on it.\nAt least how many blocks must be removed to make all squares have the same number of blocks?"},{"iden":"constraints","content":"*   $1 \\leq H,W \\leq 100$\n*   $0\\leq A_{i,j} \\leq 100$"},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$H$ $W$\n$A_{1,1}$ $A_{1,2}$ $\\ldots$ $A_{1,W}$\n$\\vdots$\n$A_{H,1}$ $A_{H,2}$ $\\ldots$ $A_{H,W}$"},{"iden":"sample input 1","content":"2 3\n2 2 3\n3 2 2"},{"iden":"sample output 1","content":"2\n\nRemoving $1$ block from the top-right square and $1$ from the bottom-left square makes all squares have $2$ blocks."},{"iden":"sample input 2","content":"3 3\n99 99 99\n99 0 99\n99 99 99"},{"iden":"sample output 2","content":"792"},{"iden":"sample input 3","content":"3 2\n4 4\n4 4\n4 4"},{"iden":"sample output 3","content":"0"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}