# Solution:

![](https://cdn.mathpix.com/cropped/2024_05_06_50f0bbe00f908a027b9ag-05.jpg?height=483&width=674&top_left_y=912&top_left_x=331)

1) $\angle A P B = \angle B A C, \angle A P B = \angle A K C, \angle A K C = \angle B A C, \angle K A C = \angle A B C$.

Segment $A C$ is a tangent to the circle.

$$
\begin{aligned}
& \triangle A B C \approx \triangle A K C \Rightarrow \\
& \frac{A B}{A K} = \frac{A C}{K C} = \frac{B C}{A C} \Rightarrow \frac{A B}{5} = \frac{A C}{2} = \frac{18}{A C} \Rightarrow A C = 6, \quad A B = 15
\end{aligned}
$$

2) $C D$ is a median $\Rightarrow$ by the cosine rule for triangles $A D C$ and $B D C$ we have $A C^{2} = A D^{2} + C D^{2} - 2 A D \cdot C D \cos \angle A D C, \quad B C^{2} = B D^{2} + C D^{2} + 2 B D \cdot C D \cos \angle A D C$.

Since $A D = B D$, then $A C^{2} + B C^{2} = 2 A D^{2} + 2 C D^{2}$, $C D^{2} = \frac{1}{2} \left( A C^{2} + B C^{2} \right) - A D^{2} = \frac{1}{2}(36 + 324) - \frac{225}{4} = \frac{495}{4}, C D = \frac{3}{2} \sqrt{55}$.

3) Let $D P = x, D N = y (N$ - the intersection point of line $C D$ with the circle, $N \neq P)$. Quadrilateral $A N B P$ is inscribed in the circle $\Rightarrow A D \cdot D B = P D \cdot B T, \frac{225}{4} = x y$. By the properties of tangents and secants to the circle, we have $C N \cdot C P = A C^{2}, (C D - y) \cdot (C D + x) = A C^{2}$, $\left( \frac{3}{2} \sqrt{55} - y \right) \cdot \left( \frac{3}{2} \sqrt{55} + x \right) = 36$.
4) Solving the system of equations $\frac{225}{4} = x y, \left( \frac{3}{2} \sqrt{55} - y \right) \cdot \left( \frac{3}{2} \sqrt{55} + x \right) = 36, \Rightarrow y = \frac{21}{\sqrt{55}} + x \Rightarrow$ $x^{2} + \frac{21}{\sqrt{55}} x - \frac{225}{4} = 0, x = \frac{-21 + 12 \sqrt{89}}{2 \sqrt{55}}, D P = \frac{-21 + 12 \sqrt{89}}{2 \sqrt{55}}$.

Answer: $\frac{-21 + 12 \sqrt{89}}{2 \sqrt{55}}$.
7. On side $B C$ of triangle $A B C$, a point $K$ is marked such that $A K=5, B K=16$, $K C=2$. A circle is circumscribed around triangle $A B K$. A line through point $C$ and the midpoint $D$ of side $A B$ intersects the circle at point $P$, with $C P>C D$. Find $D P$, if $\angle A P B=\angle B A C$.