6. Find 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 all $i, j, k \in \mathbb{N}, 1 \leqslant i<j<k \leqslant 4$, we have $a_{i}^{2}+a_{j}^{2}+a_{k}^{2} \geqslant 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} \geqslant 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 Đukić)
6. Let $\max \left\{a_{1}, a_{2}\right\} \leqslant a_{3} \leqslant a_{4}$. Denote $a_{2}=\beta^{2}$ and $a_{3}=\gamma^{2}, \beta, \gamma \geqslant 0$. From the condition of the problem, it follows that $a_{1} \leqslant(\gamma-\beta)^{2}$ and $a_{4} \geqslant(\gamma+\beta)^{2}$.

Assume that both of these inequalities are actually equalities. Then we have $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)$. Given that $\gamma \leqslant 2 \beta$, we have $\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$. Therefore, in this case, $K \geqslant \frac{11}{7}$, and equality is achieved for $a_{1}: a_{2}: a_{3}: a_{4}=1: 1: 4: 9$.

Let's also show that we can take $a_{1}=(\gamma-\beta)^{2}$ and $a_{4}=(\gamma+\beta)^{2}$. Consider the expression

$$
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 a decreasing function of $a_{1}$ for $a_{1}\frac{11}{14}\left(a_{1}+a_{2}+a_{3}\right)$, and $\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$ does not increase if $a_{4}$ is replaced by $(\gamma+\beta)^{2}$.