For every real number $x$ and every positive integer $m$, one has
$$\sum_{a=0}^{m-1} \Big\lfloor x+\frac{a}{m} \Big\rfloor = \lfloor mx \rfloor.$$
To prove this, note that $x$ belongs to the interval $[\lfloor x \rfloor + r/m, \lfloor x \rfloor + (r+1)/m[$ for some $r \in \{0,\ldots,m-1\}$, and then compute both sides of this equality. You get
$$\sum_{a=0}^{m-1} (\lfloor x \rfloor + 1_{a+r \ge m}) = m\lfloor x \rfloor + r.$$
Let $n$ be another positive integer. Given $b \in \{0,\ldots,m-1\}$, the last formula applied to $x=bn/m$ yields
$$\sum_{a=0}^{m-1} \Big\lfloor \frac{a+bn}{m} \Big\rfloor = bn.$$
Then summing over all $b \in \{0,\ldots,m-1\}$ yields
$$\sum_{a,b=0}^{m-1} \Big\lfloor \frac{a+bn}{m} \Big\rfloor = \frac{m(m-1)}{2}n .$$