Counting tuples with a prescribed sum modulo an integer
Let $r,Q,b,c,\rho\ge0$ be integers with $r\ge2$ and $2b<Q$. Then $$\#\left\{(w_1,\ldots,w_r)\in\{0,\ldots,Q-2b-1\}^r:c+\sum_iw_i\equiv\rho\pmod Q\right\} \ge Q^{r-1}\left(1-\frac{2rb}{Q}\right).$$