Consider the positive integers $\leq x$, then we know that there are $x/p + O(1)$ integers $\leq x$ that are $a \pmod{p}$ ($p$ prime).
Consider a similar problem, except this time, we are counting $(x, y) \in \mathbb{Z} \times \mathbb{Z}$ inside the box $|x| \leq B$ and $|y| \leq B$. I want to count the number of integers in this box with $x \equiv a \pmod{p}$ and $y \equiv b \pmod{p}$. Is the number of such pairs $4B^{2}/p^{2} + \text{error term}$. Is the error term $O(1)$ or $O(B)$? Can we have an error term of $O(1)$?