A plane has a special point $O$ called the origin. Let $P$ be a set of 2021 points in the plane, such that
(i) no three points in $P$ lie on a line and
(ii) no two points in $P$ lie on a line through the origin.

A triangle with vertices in $P$ is fat, if $O$ is strictly inside the triangle. Find the maximum number of fat triangles.
(Austria, Veronika Schreitter)

Answer: $2021 \cdot 505 \cdot 337$
We will count the minimal number of triangles that are not fat. Let $F$ be the set of fat triangles, and $S$ the set of triangles that are not fat. If triangle $X Y Z \in S$, we call $X$ and $Z$ good vertices if $O Y$ is located between $O X$ and $O Z$. For $A \in P$, let $S_{A} \subseteq S$ be the set of triangles in $S$ for which $A$ is one of the good vertices.

It is easy to see that

$$
2|S|=\sum_{A \in P}\left|S_{A}\right|
$$

For $A \in P$, let $R_{A} \subset P$ and $L_{A} \subset P$ be the parts of $P \backslash\{A\}$ divided by $A O$. Suppose for $A X Y \in S$ vertex $A$ is good, then clearly $X, Y \in R_{A}$ or $X, Y \in L_{A}$. On the other hand, if $X, Y \in R_{A}$ or $X, Y \in L_{A}$ then clearly $A X Y \in S$ and $A$ is its good vertex. Therefore,

$$
\left|S_{A}\right|=\binom{\left|R_{A}\right|}{2}+\binom{\left|L_{A}\right|}{2}
$$

It is easy to show the following identity:

$$
\frac{x(x-1)}{2}+\frac{y(y-1)}{2}-2 \cdot \frac{\frac{x+y}{2}\left(\frac{x+y}{2}-1\right)}{2}=\frac{(x-y)^{2}}{4}
$$

By using (2) and (3) we get

$$
\left|S_{A}\right| \geq 2 \cdot\binom{\frac{\left|R_{A}\right|+\left|L_{A}\right|}{2}}{2}=2 \cdot\binom{1010}{2}=1010 \cdot 1009
$$

and the equality holds when $\left|R_{A}\right|=\left|L_{A}\right|=1010$. Hence

$$
|S|=\frac{\sum_{A \in P}\left|S_{A}\right|}{2} \geq \frac{2021 \cdot 1010 \cdot 1009}{2}=2021 \cdot 505 \cdot 1009
$$

Therefore,

$$
|F|=\binom{2021}{3}-|S| \leq 2021 \cdot 1010 \cdot 673-2021 \cdot 505 \cdot 1009=2021 \cdot 505 \cdot 337
$$

For the configuration of points on a regular 2021-gon which is centered at $O$, the inequalities in (4), (5), (6) become equalities. Hence $2021 \cdot 505 \cdot 337$ is indeed the answer.