A natural number is written in each square of an
![m \times n](/media/m/7/7/9/77901a7e05985b397abd81d2453908b4.png)
chess board. The allowed move is to add an integer
![k](/media/m/f/1/3/f135be660b73381aa6bec048f0f79afc.png)
to each of two adjacent numbers in such a way that non-negative numbers are obtained. (Two squares are adjacent if they have a common side.) Find a necessary and sufficient condition for it to be possible for all the numbers to be zero after finitely many operations.
%V0
A natural number is written in each square of an $m \times n$ chess board. The allowed move is to add an integer $k$ to each of two adjacent numbers in such a way that non-negative numbers are obtained. (Two squares are adjacent if they have a common side.) Find a necessary and sufficient condition for it to be possible for all the numbers to be zero after finitely many operations.