4. Find the maximum value of $x+y$, if the numbers $x$ and $y$ satisfy the inequality

$$
\log _{\frac{x^{2}+y^{2}}{2}} y \geq 1
$$
Answer: $1+\sqrt{2}$ Solution. The inequality is equivalent to the system

$$
\left\{\begin{array}{c}
\frac{y-\frac{x^{2}+y^{2}}{2}}{\frac{x^{2}+y^{2}}{2}-1} \geq 0 \\
(x ; y) \neq(0 ; 0) \\
x^{2}+y^{2} \neq 2 \\
y>0
\end{array}\right.
$$

The set of solutions to this system consists of pairs of points $(x ; y)$ lying inside the upper semicircle (excluding the boundary) $x^{2}+y^{2}=2, y>0$, but outside the circle $x^{2}+(y-1)^{2}=1$ or inside the circle $x^{2}+(y-1)^{2}=1$, but outside the upper semicircle (excluding the boundary) $x^{2}+y^{2}=2, y>0$.

Let's find the maximum value of the sum $x+y$. The equation $x+y=a$ defines a family of parallel lines intersecting the $O X$ axis at an angle of $135^{\circ}$. The maximum value of $a$, for which a line from this family has a non-empty intersection with the solution set of the inequality, is found from the condition of tangency of the line $x+y=a$ and the circle $x^{2}+(y-1)^{2}=1$. This can be found either from geometric considerations or by substituting $y=a-x$ into the equation of the circle and determining $a$ for which the discriminant is zero. Of the two values $a=1 \pm \sqrt{2}$, we choose the largest one: $a=1+\sqrt{2}$. It is necessary to check that for such $a$ the line does not intersect the circle $x^{2}+y^{2}=2$, which ensures that the tangency of the first circle with our family of lines occurs before the tangency of the second.

Answer for variant 152: $-1-\sqrt{2}$.

Answer for variant 153: $-1-\sqrt{2}$.

Answer for variant 154: $1+\sqrt{2}$.