6. Determine the largest constant $K \in \mathbb{R}$ with the following property:

If $a_{1}, a_{2}, a_{3}, a_{4}>0$ are such that for any $i, j, k \in \mathbb{N}, 1 \leq i<j<k \leq 4$ it holds that $a_{i}^{2}+a_{j}^{2}+a_{k}^{2} \geq 2\left(a_{i} a_{j}+a_{j} a_{k}+a_{k} a_{i}\right)$, then

$$
a_{1}^{2}+a_{2}^{2}+a_{3}^{2}+a_{4}^{2} \geq K\left(a_{1} a_{2}+a_{1} a_{3}+a_{1} a_{4}+a_{2} a_{3}+a_{2} a_{4}+a_{3} a_{4}\right)
$$

(Dušan Djukić)

Time allowed: 270 minutes.

Each problem is worth 7 points.
6. Let $\max \left\{a_{1}, a_{2}\right\} \leqslant a_{3} \leqslant a_{4}$ and denote $a_{2}=\beta^{2}$ and $a_{3}=\gamma^{2}, \beta, \gamma \geqslant 0$. The problem condition implies $a_{1} \leqslant(\gamma-\beta)^{2}$ and $a_{4} \geqslant(\gamma+\beta)^{2}$.

Suppose for a moment that these two inequalities are in fact equalities. Then $a_{1}^{2}+a_{2}^{2}+a_{3}^{2}+a_{4}^{2}=3\left(\beta^{4}+4 \beta^{2} \gamma^{2}+\gamma^{4}\right)$ and $a_{1} a_{2}+a_{1} a_{3}+a_{1} a_{4}+a_{2} a_{3}+a_{2} a_{4}+a_{3} a_{4}=$ $3\left(\beta^{4}+\beta^{2} \gamma^{2}+\gamma^{4}\right)$. Furthermore, $\gamma \leqslant 2 \beta$, hence $\frac{\beta^{4}+4 \beta^{2} \gamma^{2}+\gamma^{4}}{\beta^{4}+\beta^{2} \gamma^{2}+\gamma^{4}}=1+\frac{3 \beta^{2} \gamma^{2}}{\beta^{4}+\beta^{2} \gamma^{2}+\gamma^{4}}=$ $1+\frac{3}{1+\frac{\beta^{2}}{\gamma^{2}}+\frac{\gamma^{2}}{\beta^{2}}} \geqslant \frac{11}{7}$, with equality for $\gamma=2 \beta$. Thus, in this case we have $K \geqslant \frac{11}{7}$, and equality is attained if $a_{1}: a_{2}: a_{3}: a_{4}=1: 1: 4: 9$.

It remains to show that we may indeed assume $a_{1}=(\gamma-\beta)^{2}$ and $a_{4}=(\gamma+\beta)^{2}$. Consider

$$
F=a_{1}^{2}+a_{2}^{2}+a_{3}^{2}+a_{4}^{2}-\frac{11}{7}\left(a_{1} a_{2}+a_{1} a_{3}+a_{1} a_{4}+a_{2} a_{3}+a_{2} a_{4}+a_{3} a_{4}\right)
$$

For fixed $a_{2}, a_{3}, a_{4}, F$ is decreasing on $a_{1}$ for $a_{1}\frac{11}{14}\left(a_{1}+a_{2}+a_{3}\right)$, whereby $\frac{11}{14}\left(a_{1}+a_{2}+a_{3}\right) \leqslant \frac{11}{14}\left(\beta^{2}+\gamma^{2}+(\gamma-\beta)^{2}\right) \leqslant$ $(\gamma+\beta)^{2} \leqslant a_{4}$, so $F$ will not increase if $a_{4}$ is changed to $(\gamma+\beta)^{2}$.