In the isosceles triangle $ABC$, $AC = BC$. A point $P$ is given on the side $AB$ such that $\angle ACP = 30^\circ$, and a point $Q$ is given outside the triangle such that

$$
\angle CPQ = \angle CPA + \angle APQ = 78^\circ.
$$

The angles of triangles $ABC$ and $QPB$ are integers when expressed in degrees. What are the angles of these two triangles?
According to the text of the task, point $P$ is on segment $AB$, and point $Q$ is in the half-plane opposite to point $C$ with respect to the line $AB$, so our diagram corresponds to the text.

Since $A C B \varangle > A C P \varangle = 30^{\circ}$, the equal angles of the isosceles triangle are smaller than $\frac{180^{\circ} - 30^{\circ}}{2} = 75^{\circ}$. According to the condition, these angles are integers, so $C A B \varangle \leq 74^{\circ}$. The external angle at $P$ in triangle $A P C$, $C P B \varangle$, is therefore at most $74^{\circ} + 30^{\circ} = 104^{\circ}$.

This means that in triangle $Q P B$, the angle $Q P B \varangle$ is at least $360^{\circ} - Q P C \varangle - C P B \varangle \geq 360^{\circ} - 78^{\circ} - 104^{\circ} \geq 178^{\circ}$. According to the condition, the angles of triangle $Q P B$ are integers when measured in degrees; since one of these angles is at least $178^{\circ}$, the other two are at least $1^{\circ} - 1^{\circ}$, so equality holds in all inequalities:

$$
\begin{array}{cc}
C A B \varangle = C B A \varangle = 74^{\circ} \quad \left(\text{ and thus } A C B \varangle = 32^{\circ}\right), \\
Q P B \varangle = 178^{\circ} \quad \text{ and } \quad P B Q \varangle = P Q B \varangle = 1^{\circ} .
\end{array}
$$

![](https://cdn.mathpix.com/cropped/2024_05_02_1be08fc7bc6dbc029920g-1.jpg?height=545&width=325&top_left_y=687&top_left_x=889)