Between what bounds does the value of the following expression vary if we substitute for $a_{1}, a_{2}, \ldots, a_{10}$ in every possible order the first 10 positive integers?

$$
K=\left|a_{1}-a_{2}\right|+\left|a_{2}-a_{3}\right|+\ldots+\left|a_{9}-a_{10}\right|+\left|a_{10}-a_{1}\right|
$$
The value of $|x-y|$ is $(x-y)$ or $(y-x)$ depending on which of $x$ and $y$ is larger. Thus, if we remove the absolute value signs in the expression $K$, each of the numbers $1, 2, \ldots, 10$ appears twice, with ten of the twenty numbers being positive and ten being negative. This means that the value of $K$ can be at most $2(10+9+9+8+7+6)-2(1+2+3+4+5)=50$. This is indeed possible, for example, if $a_{1}=10, a_{2}=1, a_{3}=9, a_{4}=2, a_{5}=8, a_{6}=3, a_{7}=7, a_{8}=4, a_{9}=6, a_{10}=5$.

To find the smallest value of $K$, let's start a beetle on the number line from $a_{1}$. Let it first go to $a_{2}$, then to $a_{3}$, then to $a_{4}$, and so on, finally from $a_{10}$ back to $a_{1}$. The value of $K$ is clearly the length of the beetle's round trip. We claim that during its journey, the beetle passes through every point in the interval $[1; 10]$ at least twice. This is clearly true for the integers, as each integer is the starting point of one segment and the endpoint of another. If $x$ is not an integer, then there is some $a_{i}$ that separates $x$ from $a_{1}$. In this case, the beetle, traveling from $a_{1}$ to $a_{i}$, passes through $x$, and since its path ends at $a_{1}$, it must touch $x$ at least once more.

Thus, the beetle traverses the segment $[1;10]$ at least twice, so $K$ is at least twice the length of the segment, i.e., at least 18. This is possible, for example, if $a_{i}=i(i=1,2, \ldots, 10)$. Thus, $18 \leqq K \leqq 50$.

Remark. If we replace 10 with $n$ in the problem ($n \geqq 2$), then by the above reasoning, it can be shown that $2 n-2 \leqq K \leqq\left[n^{2} / 2\right]$. It can be shown that $K$ takes on every even value within these bounds.