# Finding the solutions of $ax+by\le D$

Given parameters $a,b,D$, all integers, I want to find all the integer solutions $(x,y)$ of

$ax+by\le D$

Or at least a nice way to characterize them. Also, for a given $R$, it is actually enough for me to find the solutions which also satisfy

$x^2+y^2\le R^2$

(i.e. all the integer points in a some disc around the origin) but if the problem can be solved without using this additional constraint I'd be happy to hear how.

-

Let's suppose $a > 0$ (you can do the other cases yourself). Then $a x + b y \le D$ means $x \le (D - b y)/a$. So for any integer $y$, $x$ is any integer $\le \lfloor (D - b y)/a \rfloor$.