[Circles](https://artofproblemsolving.com/wiki/index.php/Circle) $\mathcal{C}_1, \mathcal{C}_2,$ and $\mathcal{C}_3$ have their [centers](https://artofproblemsolving.com/wiki/index.php/Center) at (0,0), (12,0), and (24,0), and have [radii](https://artofproblemsolving.com/wiki/index.php/Radius) 1, 2, and 4, respectively. Line $t_1$ is a common internal [tangent](https://artofproblemsolving.com/wiki/index.php/Tangent) to $\mathcal{C}_1$ and $\mathcal{C}_2$ and has a positive [slope](https://artofproblemsolving.com/wiki/index.php/Slope), and line $t_2$ is a common internal tangent to $\mathcal{C}_2$ and $\mathcal{C}_3$ and has a negative slope. Given that lines $t_1$ and $t_2$ intersect at $(x,y),$ and that $x=p-q\sqrt{r},$ where $p, q,$ and $r$ are positive integers and $r$ is not divisible by the square of any prime, find $p+q+r.$
[2006 II AIME-9.png](https://artofproblemsolving.com/wiki/index.php/File:2006_II_AIME-9.png)
Call the centers $O_1, O_2, O_3$, the points of tangency $r_1, r_2, s_1, s_2$ (with $r$ on $t_1$ and $s$ on $t_2$, and $s_2$ on $\mathcal{C}_2$), and the intersection of each common internal tangent to the [X-axis](https://artofproblemsolving.com/wiki/index.php/X-axis) $r, s$. $\triangle O_1r_1r \sim \triangle O_2r_2r$ since both triangles have a [right angle](https://artofproblemsolving.com/wiki/index.php/Right_angle) and have vertical angles, and the same goes for $\triangle O_2s_2s \sim \triangle O_3s_1s$. By [proportionality](https://artofproblemsolving.com/wiki/index.php/Proportion), we find that $O_1r = 4$; solving $\triangle O_1r_1r$ by the [Pythagorean theorem](https://artofproblemsolving.com/wiki/index.php/Pythagorean_theorem) yields $r_1r = \sqrt{15}$. On $\mathcal{C}_3$, we can do the same thing to get $O_3s_1 = 4$ and $s_1s = 4\sqrt{3}$.
The vertical [altitude](https://artofproblemsolving.com/wiki/index.php/Altitude) of each of $\triangle O_1r_1r$ and $\triangle O_3s_1s$ can each by found by the formula $c \cdot h = a \cdot b$ (as both products equal twice of the area of the triangle). Thus, the respective heights are $\frac{\sqrt{15}}{4}$ and $2\sqrt{3}$. The horizontal distance from each altitude to the intersection of the tangent with the x-axis can also be determined by the Pythagorean theorem: $\sqrt{15 - \frac{15}{16}} = \frac{15}{4}$, and by 30-60-90: $6$. 
From this information, the slope of each tangent can be uncovered. The slope of $t_1 = \frac{\Delta y}{\Delta x} = \frac{\frac{\sqrt{15}}{4}}{\frac{15}{4}} = \frac{1}{\sqrt{15}}$. The slope of $t_2 = -\frac{2\sqrt{3}}{6} = -\frac{1}{\sqrt{3}}$.
The equation of $t_1$ can be found by substituting the point $r (4,0)$ into $y = \frac{1}{\sqrt{15}}x + b$, so $y = \frac{1}{\sqrt{15}}x - \frac{4}{\sqrt{15}}$. The equation of $t_2$, found by substituting point $s (16,0)$, is $y = \frac{-1}{\sqrt{3}}x + \frac{16}{\sqrt{3}}$. Putting these two equations together results in the desired $\frac{1}{\sqrt{15}}x - \frac{4}{\sqrt{15}} = -\frac{1}{\sqrt{3}}x + \frac{16}{\sqrt{3}}$ $\Longrightarrow x = \frac{16\sqrt{5} + 4}{\sqrt{5} + 1} \cdot \frac{\sqrt{5}-1}{\sqrt{5}-1}$ $= \frac{76 - 12\sqrt{5}}{4}$ $= 19 - 3\sqrt{5}$. Thus, $p + q + r = 19 + 3 + 5 \Longrightarrow \boxed{027}$.