1. Solve the inequality

$$
\operatorname{tg}^{2} x_{1}+\operatorname{tg}^{2} x_{2}+\ldots+\operatorname{tg}^{2} x_{997}+\operatorname{ctg}^{2} x_{1}+\operatorname{ctg}^{2} x_{2}+\ldots+\operatorname{ctg}^{2} x_{997} \leq 1994
$$
Solution. The given inequality is equivalent to the inequality:

$$
\left(\operatorname{tg} x_{1}-\operatorname{ctg} x_{1}\right)^{2}+\left(\operatorname{tg} x_{2}-\operatorname{ctg} x_{2}\right)^{2}+\ldots+\left(\operatorname{tg} x_{997}-\operatorname{ctg} x_{997}\right)^{2} \leq 0
$$

from which we obtain that for every $i \in\{1,2, \ldots, 997\}$ it holds:

$$
\operatorname{tg} x_{i}-\operatorname{ctg} x_{i}=0
$$

or equivalently

$$
\operatorname{tg} x_{i}=\operatorname{ctg} x_{i}
$$

From the last equation, we obtain that for $i \in\{1,2, \ldots, 997\}$ it holds:

$$
x_{i} \in\left\{\left.\frac{\pi}{4}+k \pi \right\rvert\, k \in \mathbb{Z}\right\} \cup\left\{\left.\frac{3 \pi}{4}+m \pi \right\rvert\, m \in \mathbb{Z}\right\}
$$

For such values of $x_{i}$, in fact, equality holds in the inequality.