## 1. Points in a Triangle

In a rectangular coordinate system, a triangle $ABC$ is given with vertices $A(-20,0), B(20,0)$, and $C(0,40)$. How many points with both coordinates being integers lie inside or on the boundary of this triangle?

Result: $\quad 841$
## Solution.

If we denote the coordinates of the sought points as $(x, y)$, then the smallest possible integer $y$ is 0, and the largest is 40.

For $y=0$ in the triangle $\triangle A B C$, there are 41 points with integer coordinates.

For $y=1$ there are 39.

For $y=2$ there are also 39.

For $y=3$ there are 37.

For $y=4$ there are 37.

...

For $y=37$ there are 3.

For $y=38$ there are 3.

For $y=39$ there is 1.

For $y=40$ there is 1.

Thus, the total number of points with the given property is:

$41+2 \cdot(39+37+\cdots+3+1)$

$=41+2 \cdot \frac{20 \cdot 40}{2}=41+800$

![](https://cdn.mathpix.com/cropped/2024_05_30_e6d161e17f72e23e8b9eg-1.jpg?height=954&width=1013&top_left_y=1356&top_left_x=887)

$=841$.