Example 8 There are three people, $A$, $B$, and $C$, playing table tennis. When two of them play, the third one acts as the referee. In this match, the loser will be the referee in the next match, and the other two will continue to play. After several matches, it is known that $A$ has played a total of $a$ matches, and $B$ has played a total of $b$ matches. Find the minimum number of matches $C$ has played. (Original problem)
Let $C$ have played $c$ games, then the total number of player appearances is $a+b+c$, but each game produces 2 player appearances, so the total number of games played is $\frac{a+b+c}{2}$.

Therefore, the number of games where $C$ was the referee is $\frac{a+b+c}{2}-c=\frac{a+b-c}{2}$.
Since if $C$ is the referee in a certain game, he must play in the next game, thus $C$ cannot be the referee in two consecutive games, hence, $\frac{a+b-c}{2} \leqslant c+1$, solving this gives $c \geqslant \frac{a+b-2}{3}$.

Since $c$ is an integer, we have $c \geqslant\left[\frac{a+b-2}{3}+\frac{2}{3}\right]=\left[\frac{a+b}{3}\right]$.
When $a+b=3 k$, $c \geqslant\left[\frac{a+b}{3}\right]=k$. Let $a=2 k, b=k$, and use $(A, B, C)$ to denote the game where $A$ and $B$ play and $C$ is the referee, then all the games are $(A, B, C),(A, C, B)$, $(A, B, C),(A, C, B), \cdots,(A, B, C),(A, C, B)$, a total of $2 k$ games, at this time $c=k=\left[\frac{a+b}{3}\right]$.

When $a+b=3 k+1$, $c \geqslant\left[\frac{a+b}{3}\right]=k$, but $a+b+c \equiv a+b-c \equiv 0(\bmod 2)$, so $c \neq k$, thus $c \geqslant k+1=\left[\frac{a+b}{3}\right]+1$. Let $a=2 k, b=k+1$, and use $(A, B, C)$ to denote the game where $A$ and $B$ play and $C$ is the referee, then all the games are $(A, B, C),(A, C, B),(A, B, C),(A, C, B), \cdots,(A, B, C),(A, C, B), \underline{(B,}$ $\underline{C}, A)$, a total of $2 k+1$ games, at this time $c=k+1=\left[\frac{a+b}{3}\right]+1$;

When $a+b=3 k+2$, $c \geqslant\left[\frac{a+b}{3}\right]=k$. Let $a=2 k+1, b=k+1$, and use $(A, B, C)$ to denote the game where $A$ and $B$ play and $C$ is the referee, then all the games are $(A, B, C),(A, C, B),(A, B, C),(A, C, B), \cdots,(A, B, C),(A, C, B),(A, B, C)$, a total of $2 k+1$ games, at this time $c=k=\left[\frac{a+b}{3}\right]$. In summary, $c_{\min }=\left\{\begin{array}{ll}{\left[\frac{a+b}{3}\right]} & (a+b \equiv 0,2(\bmod 3) ; \\ {\left[\frac{a+b}{3}\right]+1} & (a+b \equiv 1(\bmod 3)\end{array}\right.$