5. Three people, A, B, and C, are dividing candies. The distribution method is as follows: first, write three positive integers $p, q, r$ on three pieces of paper, such that $p < q < r$. Then, each person draws a piece of paper, and the number on the paper is the number of candies they get in that round. After several rounds of this distribution, A gets a total of 20 candies, B gets 10 candies, and C gets 9 candies. It is also known that in the last round, B drew the paper with the number $r$, and the sum of the numbers C drew in all rounds is 18. What are the three positive integers $p, q, r$? Why?
Solution: Let there be $n$ rounds of distribution ($n$ is a positive integer).
According to the situation of C, we have $18-np=9, np=9$. The value of $n$ can only be $1, 3, 9$.

When $n=1$, only one round of distribution has taken place, and obviously, one of A, B, and C must have received 0 candies according to the above distribution method, which contradicts the problem statement.

When $n=9$, the total number of candies is $20+10+9=39$. Since the number of candies distributed each round is the same, and 9 does not divide 39, this is incorrect.

Therefore, $n=3$, and we get $p=3$. The number of candies distributed each round is 13. Thus,
$$
r-p+q-p=13, r+q=19 \text{. }
$$

Since $r>q$, we have $r \geqslant 10, q \leqslant 9$. We also know that if someone draws the numbers $r, q, p$ on the slips of paper three times, the number of candies they receive should be 13. Since B drew the number $r$ on the last slip of paper and ended up with 10 candies, B must have drawn the numbers $r$ and $p$ twice. Therefore, $r-p=10, r=13, q=19-13=6$.

In conclusion, $r, p, q$ are the positive integers $13, 6, 3$, respectively.