<s>[INST] Given triangle ABC and its inscribed circle O, AO = 3, BO = 4, CO = 5, find the perimeter of ABC As title,

I could only figure out that
$$a^2 + r^2 = 9$$
$$b^2 + r^2 = 16$$
$$c^2 + r^2 = 25$$
$$r^2 = \frac{abc}{a+b+c}$$
But couldn't get how to derive $2(a+b+c)$.
 [/INST] In a triangle $ABC$ with sides $a,b,c$ opposite to $A,B,C$, respectively, and with incenter $I$, one has $$AI^2 = bc\cdot \frac{b+c-a}{a+b+c}, \quad BI^2 = ca\cdot \frac{c+a-b}{a+b+c}, \quad CI^2 = ab\cdot \frac{a+b-c}{a+b+c}.$$
The conditions $AI=3$, $BI=4$ and $CI=5$ can be rewritten as
$$\lambda := \frac{2abc}{a+b+c} = bc-9 = ca-16 = ab - 25.$$
One gets $$a^2=\frac{ab\cdot ac}{bc} = \frac{(\lambda+16)(\lambda+25)}{\lambda+9}$$ and similarly $$b^2=\frac{(\lambda+9)(\lambda+25)}{\lambda+16}, \quad c^2=\frac{(\lambda+9)(\lambda+16)}{\lambda+25}.$$
Substituting this into $\lambda = \dfrac{2abc}{a+b+c}$ one obtains
$$\lambda = \frac{2(\lambda+9)(\lambda+16)(\lambda+25)}{(\lambda+9)(\lambda+16)+(\lambda+9)(\lambda+25)+(\lambda+16)(\lambda+25)}$$
which, according to wolframalpha, is equivalent to $$\lambda^3-769\lambda-7200=0,$$
hence the answer is
$$\sqrt{\frac{(\lambda+16)(\lambda+25)}{\lambda+9}} + \sqrt{\frac{(\lambda+9)(\lambda+25)}{\lambda+16}} + \sqrt{\frac{(\lambda+9)(\lambda+16)}{\lambda+25}}$$ where $$\lambda = \frac{\sqrt[3]{32400 + i \sqrt{314509827}}}{3^{2/3}} + \frac{769}{\sqrt[3]{3(32400 + i \sqrt{314509827})}} \approx 31.5756803606316$$
is the positive root of $\lambda^3-769\lambda-7200=0$.
</s>