[guided]We isolate the basic fact about a single cycle. Fix $i \in \{1,\dots,r\}$, and write
\begin{align*}
c_i=(a_{i,1}\ a_{i,2}\ \cdots\ a_{i,m_i}).
\end{align*}
The elements $a_{i,1},\dots,a_{i,m_i}$ form the support
\begin{align*}
A_i:=\{a_{i,1},\dots,a_{i,m_i}\}.
\end{align*}
On this support, the cycle advances one position:
\begin{align*}
c_i(a_{i,j})=a_{i,j+1}.
\end{align*}
Here the subscript is read cyclically modulo $m_i$, meaning $a_{i,m_i+1}=a_{i,1}$ and, more generally, $a_{i,q}=a_{i,s}$ exactly when $q \equiv s \pmod{m_i}$.
Applying the same cycle $k$ times advances $k$ positions, so for every $j \in \{1,\dots,m_i\}$,
\begin{align*}
c_i^k(a_{i,j})=a_{i,j+k}.
\end{align*}
Thus $c_i^k$ fixes $a_{i,j}$ exactly when $a_{i,j+k}=a_{i,j}$, which by the cyclic indexing condition is equivalent to
\begin{align*}
j+k \equiv j \pmod{m_i}.
\end{align*}
Subtracting $j$ from both sides gives
\begin{align*}
k \equiv 0 \pmod{m_i}.
\end{align*}
This congruence is exactly the divisibility condition $m_i \mid k$.
The cycle $c_i$ already fixes every element outside $A_i$, and so every power $c_i^k$ also fixes every element outside $A_i$. Therefore $c_i^k$ is the identity permutation on all of $\{1,\dots,n\}$ if and only if it fixes the elements of $A_i$, and this happens if and only if
\begin{align*}
m_i \mid k.
\end{align*}
Hence
\begin{align*}
c_i^k=e \iff m_i \mid k.
\end{align*}[/guided]