In the first example test, the configuration of numbers changes as follows:

\begin{center}
$1$ \underline{$3$ $5$} $2$ $4$ \, $\rightarrow$ \, \underline{$1$ $5$} $3$ $2$ $4$ \, $\rightarrow$ \, $5$ \underline{$1$ $3$} $2$ $4$ \, $\rightarrow$ \, $5$ $3$ $1$ \underline{$2$ $4$} \, $\rightarrow$ \, \underline{$5$ $3$} $1$ $4$ $2$ \, $\rightarrow$ \, $3$ $5$ $1$ $4$ $2$
\end{center}

In the second example test, making even a single swap in the initial configuration is impossible.