There is a common result that for odd, relatively prime positive integers $a,b,$ $\sum\limits_{x=1}^{\frac{b-1}{2}}\lfloor\frac{ax}{b}\rfloor+\sum\limits^{\frac{a-1}{2}}_{y=1}\lfloor\frac{by}{a}\rfloor=\frac{a-1}{2}\frac{b-1}{2},$ used as a rather important step for proving quadratic reciprocity. I have proven this with a geometric argument, considering a rectangle in the Cartesian plane with side lengths $\frac{a+1}{2},\frac{b+1}{2},$ then proving that the LHS counts the number of lattice points situated entirely in the rectangle's interior, as does the RHS by considering its area.
However, is there a nice non-geometric proof of this? I see that the $\lfloor\frac{ax}{b}\rfloor$ terms can be interpreted as quotients of steps of the division algorithm; that is, with $ax=bq_x+r_x,$ we know $r_x<b,$ so that floor function just results in $q_x.$ I think I see a way forward with showing that the remainders are distinct and applying some combinatorial argument to the number of times unique quotients show up, but it seems pretty messy. Is there a straightforward algebraic argument?