6. Rays $A B$ and $D C$ intersect at point $P$, and rays $B C$ and $A D$ intersect at point $Q$. It is known that triangles $A D P$ and $Q A B$ are similar (vertices are not necessarily in the corresponding order), and quadrilateral $A B C D$ can be inscribed in a circle of radius 4.

a) Find $A C$.

b) Suppose it is additionally known that the circles inscribed in triangles $A B C$ and $A C D$ touch segment $A C$ at points $K$ and $T$ respectively, and that $C K: K T: T A=3: 1: 4$ (point $T$ lies between $K$ and $A$). Find $\angle D A C$ and the area of quadrilateral $A B C D$.
Answer. a) $A C=8$; b) $\angle D A C=45^{\circ}, S_{A B C D}=31$.

Solution. a) Similarity of triangles is equivalent to the equality of all their angles. Since the angle at vertex $A$ is common to both triangles, there are two options: either $\angle A B Q=\angle A D P, \angle A Q B=\angle A P D$, or $\angle A B Q=\angle A P D$, $\angle A Q B=\angle A D P$. The second case is impossible because $\angle A D P$ is the exterior angle of triangle $C D Q$, so it equals the sum of $\angle D C Q+\angle D Q C$, i.e., $\angle A D P>\angle A Q B$. Therefore, only the first case remains, and $\angle A B C=\angle A D C$. Since quadrilateral $A B C D$ is inscribed in a circle, $\angle A B C+\angle A D C=180^{\circ}$, from which $\angle A B C=\angle A D C=90^{\circ}$. Consequently, $A C$ is the diameter of the circle, $A C=8$.

b) Let the circle inscribed in triangle $A B C$ touch its sides $A B$ and $B C$ at points $M$ and $N$, respectively, and the circle inscribed in triangle $A C D$ touch its sides $A D$ and $C D$ at points $L$ and $G$, respectively. Note that under the additional condition $A T=T C$. By the property of tangent segments to a circle, $A L=A T=T C=C G, D G=D L$. Therefore, triangle $A C D$ is isosceles, and since $\angle D=90^{\circ}$, $\angle D A C=45^{\circ}$. The area of triangle $A C D$ is $0.5 A C \cdot D T=16$.

Now apply the property of tangents to triangle $A B C$: $C N=C K=3, A M=A K=5$; let $B N=B M=x$. By the Pythagorean theorem for triangle $A B C$, we get $64=(x+5)^{2}+(x+3)^{2}, x^{2}+8 x-15=0$, $x=\sqrt{31}-4$. Then $A B=\sqrt{31}+1, B C=\sqrt{31}-1$ and the area of triangle $A B C$ is $0.5 A B \cdot B C=15$. Therefore, the area of quadrilateral $A B C D$ is $16+15=31$.