6. A circle passes through vertices $A$ and $B$ of triangle $ABC$ and intersects its sides $AC$ and $BC$ at points $Q$ and $N$ respectively, such that $AQ: QC = 5: 2$ and $CN: NB = 5: 2$. Find $AB$, if $QN = 5 \sqrt{2}$.
Answer: $7 \sqrt{5}$.

Solution. Let $C Q=2 x, C N=5 y$; then $A Q=5 x, C T=2 y$. By the theorem of two secants $C Q \cdot C A=C N \cdot C B$, from which $2 x \cdot 7 x=5 y \cdot 7 y, y=x \sqrt{\frac{2}{5}}$. Triangles $A B C$ and $N Q C$ are similar by two sides and the angle between them ( $C A: C N=C B: C Q, \quad \angle C-$ is common), and the similarity coefficient is $\frac{B C}{B Q}=\frac{7 y}{2 x}=\frac{7}{2} \sqrt{\frac{2}{5}}=\frac{7}{\sqrt{10}}$. Therefore, $A B=Q N \cdot \frac{7}{\sqrt{10}}=7 \sqrt{5}$.