## Solution.

![](https://cdn.mathpix.com/cropped/2024_05_30_c317f9bfd22736a3ecebg-19.jpg?height=645&width=788&top_left_y=294&top_left_x=560)

The graph of the given function is a parabola with roots at $(0,0)$ and $(2022,0)$.

1 point

According to the condition in the problem, all points between the roots on the x-axis need to be marked. These are the points from $(1,0)$ to $(2021,0)$, which means 2021 points are marked in red.

The number of blue points depends on the condition $y \geqslant -2023$. We need to find the condition on the x-coordinates of the points whose y-coordinates are greater than or equal to -2023. Therefore, we need to solve the inequality

$$
-x^{2} + 2022x \geqslant -2023
$$

or equivalently $x^{2} - 2022x - 2023 \leqslant 0$, which can be written in the form of a product

$$
(x + 1)(x - 2023) \leqslant 0
$$

The solution to this quadratic inequality is $x \in [-1, 2023]$.

The number of integer points on the parabola is equal to the number of integers in the obtained interval, which is 2025.

1 point

The number of ways to choose two blue vertices is $\frac{2025 \cdot 2024}{2}$, and

1 point

1 point

one red vertex can be chosen in 2021 ways.

Therefore, the total number of triangles with two blue and one red vertex is

$$
\frac{2025 \cdot 2024}{2} \cdot 2021
$$

but from this number, we need to subtract the triangles where the two blue vertices are at $(0,0)$ and $(2022,0)$ and the third vertex is one of the red points, as they lie on the same line. Therefore, the total number of triangles is

$$
\frac{2025 \cdot 2024}{2} \cdot 2021 - 2021 = 2025 \cdot 1012 \cdot 2021 - 2021 = 4141633279
$$

Note: The first point can be awarded for a sketch clearly marking the roots.

Note: The process of solving the inequality $x^{2} - 2022x - 2023 \leqslant 0$ is worth one point. The student does not necessarily have to solve the inequality by factorization.

Note: Any final answer in the last line is accepted.

## ZUPANIJSKO NATJECANJE IZ MATEMATIKE

## 3rd grade - high school - B variant

March 24, 2022.

## IF THE STUDENT HAS A DIFFERENT SOLUTION APPROACH, THE COMMITTEE IS OBLIGED TO GRADE AND EVALUATE THAT APPROACH APPROPRIATELY.
## Task B-2.7.

On the graph of the function $f(x)=-x^{2}+2022 x$, all integer points $(x, y)$ for which $y \geqslant-2023$ are marked in blue. On the x-axis, all integer points $(x, 0)$ are marked in red such that $a<x<b, f(a)=f(b)=0$. How many different triangles are there with vertices at two blue points and one red point?