I recently discovered the benaloh cryptosystem. I am working with the system as it is discribed in the following link: https://en.wikipedia.org/wiki/Benaloh_cryptosystem
However I need some help in order to understand why we need \begin{equation} {gcd(r,(p-1)/r)} \end{equation}
As far as I understand the condition \begin{equation} r \mid (p-1) \end{equation} guarantees the existence of the subgroup of order (p-1)/r which contains the r-residues.
The third condition
\begin{equation} {gcd(r,(q-1))} \end{equation}
allows us to say that there are
\begin{equation} \mid \mathbb{Z}_n^* \mid /r \end{equation} r-residues mod n.
what does the other condition add?