I have the following congruence equation system:
$$ \left\{ \begin{array}{c} x \equiv 7 \pmod{7} \\ x \equiv 4 \pmod{12} \\ x \equiv 16 \pmod{21} \\\end{array} \right. $$
I understand that:
$$x\equiv a (mod w) \wedge \ x \equiv b (mod k)$$ has a solution iff $$gcd(w,k)| (b-a)$$
So I operated and found:
$$gcd(7,12) = 1 | (7-4) \rightarrow 1 | 3 : true$$ $$gcd(12,21) = 3 | (16-4) \rightarrow 3 | 12 : true$$ $$gcd(7,21) = 7 | (16-7) \rightarrow 9 | 7 : false$$
And concluded that the system does not have a solution, however, it appears to be a wrong procedure according to my teacher, and I would like to know the correct approach.
Thanks in advance.