In triangle $ABC$, $AP$ is the angle bisector In triangle $ABC$, $AP$ is the angle bisector of $\measuredangle A$. If $BP=16,CP=20$ and the center of the circumcircle of $\triangle ABP$ lies on $AC$, find $AB$ and $AC$.

$AP$ is the angle bisector of $\measuredangle BAC$ which means that $\measuredangle BAP=\measuredangle CAP=\alpha$. On the other hand, $OA=OP=R_{\triangle ABP}=R$, so $\measuredangle PAO=\measuredangle APO=\alpha$. This makes $OP\parallel AB$. I am trying to figure out the best way to use that parallelity.
The most straightforward think we can note is $\triangle OPC\sim\triangle ABC$. I don't see if this can be helpful, though.
Another true thing is $\dfrac{BP}{PC}=\dfrac{AB}{AC}=\dfrac{16}{20}=\dfrac{4}{5}$.

Let's say the radius of the circle is $r$. Call the intersection of $OC$ with the circle, $D\neq A$.
Using similarity, we have
$$\frac{r+DC}{r}=\frac{20}{16}$$
$$4(r+DC)=5r$$
$$DC=\frac{r}{4}$$
Evaluating the power of point $C$, we get that
$$CD\cdot AC=20\cdot 36$$
$$\frac{r}{4}\cdot \frac{9r}{4}=20\cdot 36$$
$$r=16\sqrt{5}$$
$$AC=\frac{9r}{4}=\boxed{36\sqrt{5}}$$
Using angle bisector theorem, we have
$$16\cdot AC=20\cdot AB$$
$$AB=\frac{4}{5}\cdot 36\sqrt{5}$$
$$AB=\boxed{\frac{144\sqrt{5}}{5}}$$
