Problem

Source: 2019 Thailand October Camp TSTST 1.4

Tags: combinatorics, table



A $1\times 2019$ board is filled with numbers $1, 2, \dots, 2019$ in an increasing order. In each step, three consecutive tiles are selected, then one of the following operations is performed: $\text{(i)}$ the number in the middle is increased by $2$ and its neighbors are decreased by $1$, or $\text{(ii)}$ the number in the middle is decreased by $2$ and its neighbors are increased by $1$. After several such operations, the board again contains all the numbers $1, 2,\dots, 2019$. Prove that each number is in its original position.