Navvye/Olympiad-Problems-CSV huggingface dataset:
Problem: Square $ABCD$ has center $O,\ AB=900,\ E$ and $F$ are on $AB$ with $AE<BF$ and $E$ between $A$ and $F, m\angle EOF =45^\circ,$ and $EF=400.$ Given that $BF=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.$

Solution: Let lower case letters be the complex numbers correspond to their respective upper case points in the complex plane, with $o = 0, a = -450 + 450i, b = 450 + 450i$ , and $f = x + 450i$ . Since $EF$ = 400, $e = (x-400) + 450i$ . From $\angle{EOF} = 45^{\circ}$ , we can deduce that the rotation of point $F$ 45 degrees counterclockwise, $E$ , and the origin are collinear. In other words, \[\dfrac{e^{i \frac{\pi}{4}} \cdot (x + 450i)}{(x - 400) + 450i}\] is a real number. Simplyfying using the fact that $e^{i \frac{\pi}{4}} = \dfrac{\sqrt{2}}{2} + i \dfrac{\sqrt{2}}{2}$ , clearing the denominator, and setting the imaginary part equal to $0$ , we eventually get the quadratic \[x^2 - 400x + 22500 = 0\] which has solutions $x = 200 \pm 50\sqrt{7}$ . It is given that $AE < BF$ , so $x = 200 - 50\sqrt{7}$ and \[BF = 450 - (200 - 50\sqrt{7}) = 250 + 50\sqrt{7} \Rightarrow \boxed{307}.\]

Answer:  307
Problem: Square $ABCD$ has center $O,\ AB=900,\ E$ and $F$ are on $AB$ with $AE<BF$ and $E$ between $A$ and $F, m\angle EOF =45^\circ,$ and $EF=400.$ Given that $BF=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.$

Solution: [asy] size(250); pair A,B,C,D,O,E,F,G,H,K; A = (0,0); B = (900,0); C = (900,900); D = (0,900); O = (450,450); E = (600,0); F = (150,0); G = (-600,0); H = (450,0); K = (0,270); draw(A--B--C--D--cycle); draw(O--E); draw(O--F); draw(O--G); draw(A--G); draw(O--H); label("O",O,N); label("A",A,S); label("B",B,SE); label("C",C,NE); label("D",D,NW); label("E",E,SE); label("F",F,S); label("H",H,SW); label("G",G,SW); label("x",H--E,S); label("K",K,NW); [/asy] Let G be a point such that it lies on AB, and GOE is 90 degrees. Let H be foot of the altitude from O to AB.
Since $\triangle GOE \sim \triangle OHE$ $\frac{GO}{OE} = \frac{450}{x}$ , and by Angle Bisector Theorem $\frac{GF}{FE} = \frac{450}{x}$ . Thus, $GF = \frac{450 \cdot 400}{x}$ $AF = AH-FH = 50+x$ , and $KA = EB$ (90 degree rotation), and now we can bash on 2 similar triangles $\triangle GAK \sim \triangle GHO$
\[\frac{GA}{AK} = \frac{GH}{OH}\] \[\frac{\frac{450 \cdot 400}{x}-50-x}{450-x} = \frac{\frac{450 \cdot 400}{x}+400-x}{450}\] I hope you like expanding \[x^2 - 850x + \frac{81000000}{x} = -450x - 22500 + \frac{81000000}{x}\] \[x^2 - 400x + 22500 = 0\] Quadratic formula gives us \[x = 200 \pm 50 \sqrt{7}\] Since AE < BF \[x = 200 - 50 \sqrt{7}\] Thus, \[BF = 250 + 50 \sqrt{7}\] So, our answer is $\boxed{307}$

Answer:  307
Problem: Square $ABCD$ has center $O,\ AB=900,\ E$ and $F$ are on $AB$ with $AE<BF$ and $E$ between $A$ and $F, m\angle EOF =45^\circ,$ and $EF=400.$ Given that $BF=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.$

Solution: We know that G is on the perpendicular bisector of $EF$ , which means that $EJ=JF=200$ $EG=GF=200\sqrt{2}$ and $GH=250$ . Now, let $HO$ be equal to $x$ . We can set up an equation with the Pythagorean Theorem:
\begin{align*} \sqrt{x^2+250^2}&=(200\sqrt{2})^2 \\ x^2+62500&=80000 \\ x^2&=17500 \\ x&=50\sqrt{7} \end{align*}
Now, since $IO=450$
\begin{align*} HI&=450-x \\ &=450-50\sqrt{7} \\ \end{align*} \\
Since $HI=AJ$ , we now have:
\begin{align*} BF&=AB-AJ-JF \\ &=900-(450-50\sqrt{7})-200 \\ &=250+50\sqrt{7} \\ \end{align*}
This means that our answer would be $250+50+7=\boxed{307}$

Answer:  307
Problem: Square $ABCD$ has center $O,\ AB=900,\ E$ and $F$ are on $AB$ with $AE<BF$ and $E$ between $A$ and $F, m\angle EOF =45^\circ,$ and $EF=400.$ Given that $BF=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.$

Solution: Construct $BO, AO.$ Let $\angle{FOB} = \alpha.$ Also let $FB = x$ then $AE = 500-x.$ We then have from simple angle-chasing: \begin{align*} \angle{BFO} = 135 - \alpha \\ \angle{OFE} = 45 + \alpha \\ \angle{EOA} = 45 - \alpha \\ \angle{AEO} = 90 + \alpha \\ \angle{OEF} = 90 - \alpha. \end{align*} From AA similarity we have \[\triangle{EOB} \sim \triangle{EFO}.\] This gives the ratios, \[\dfrac{400 + x}{EO} = \dfrac{450\sqrt{2}}{FO}.\] Similarly from AA similarity \[\triangle{FOA} \sim \triangle{FEO}.\] So we get the ratios \[\dfrac{EO}{450\sqrt{2}} = \dfrac{FO}{900-x}.\] We can multiply to get \[\dfrac{400 + x}{450\sqrt{2}} = \dfrac{450\sqrt{2}}{900 - x}.\] Cross-multiplying reveals \[360000 + 500x - x^2 = 405000.\] Bringing everything to one side we have \[x^2 - 500x + 45000 = 0.\] By the quadratic formula we get \[x = \dfrac{500 + \sqrt{500^2 - 4\cdot45000}}{2} = \dfrac{500 + \sqrt{70000}}{2} = \dfrac{500 + 100\sqrt{7}}{2} = 250 + 50\sqrt{7}.\] Therefore \[p+q+r = 250 + 50 + 7 = \boxed{307}.\] ~aa1024

Answer:  307
Problem: Square $ABCD$ has center $O,\ AB=900,\ E$ and $F$ are on $AB$ with $AE<BF$ and $E$ between $A$ and $F, m\angle EOF =45^\circ,$ and $EF=400.$ Given that $BF=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.$

Solution: Draw AO, OB, and extend OB to D. Let $\angle{FOB} = \alpha.$ Then, after angle chasing, we find that \[\angle{AEB} = 90 + \alpha\] . 
Using this, we draw a line perpendicular to $AB$ at $E$ to meet $BD$ at $M$ . Since $\angle{MEO} = \alpha$ and $\angle{EMO} = 45$ , we have that \[\triangle{EMO} \sim \triangle{OBF}\] Let $FB = x$ . Then $EM = 400+x$ . Since $FB/BO = \frac{x}{450\sqrt{2}}$ , and $MO/EM = FB/OB$ , we have \[MO = \frac{(400+x)x}{450\sqrt{2}}\] Since $\triangle{EBM}$ is a $45-45-90$ triangle, \[(400+x)\sqrt{2} = 450 \sqrt{2} + \frac{(400+x)x}{450\sqrt{2}}\] Solving for $x$ , we get that $x=250 +- 50s\sqrt{7}$ , but since $FB>AE$ $FB = 250+50\sqrt{7}$ , thus \[p+q+r=\boxed{307}\] -dchang0524

Answer:  307
Problem: Let $P(x)$ be a polynomial with integer coefficients that satisfies $P(17)=10$ and $P(24)=17.$ Given that $P(n)=n+3$ has two distinct integer solutions $n_1$ and $n_2,$ find the product $n_1\cdot n_2.$

Solution: We define $Q(x)=P(x)-x+7$ , noting that it has roots at $17$ and $24$ . Hence $P(x)-x+7=A(x-17)(x-24)$ . In particular, this means that $P(x)-x-3=A(x-17)(x-24)-10$ . Therefore, $x=n_1,n_2$ satisfy $A(x-17)(x-24)=10$ , where $A$ $(x-17)$ , and $(x-24)$ are integers. This cannot occur if $x\le 17$ or $x\ge 24$ because the product $(x-17)(x-24)$ will either be too large or not be a divisor of $10$ . We find that $x=19$ and $x=22$ are the only values that allow $(x-17)(x-24)$ to be a factor of $10$ .  Hence the answer is $19\cdot 22=\boxed{418}$

Answer:  418
Problem: Let $P(x)$ be a polynomial with integer coefficients that satisfies $P(17)=10$ and $P(24)=17.$ Given that $P(n)=n+3$ has two distinct integer solutions $n_1$ and $n_2,$ find the product $n_1\cdot n_2.$

Solution: We know that $P(n)-(n+3)=0$ so $P(n)$ has two distinct solutions so $P(x)$ is at least quadratic. Let us first try this problem out as if $P(x)$ is a quadratic polynomial. Thus $P(n)-(n+3)= an^2+(b-1)n+(c-3)=0$ because $P(n)=an^2+bn+c$ where $a,b,c$ are all integers. Thus $P(x)=ax^2+bx+c$ where $a,b,c$ are all integers. We know that $P(17)$ or $289a+17b+c=10$ and $P(24)$ or $576a+24b+c=17$ . By doing $P(24)-P(17)$ we obtain that $287a+7b=7$ or $41a+b=1$ or $-41a=b-1$ . Thus $P(n)=an^2- (41a)n+(c-3)=0$ .  Now we know that $b=-41a+1$ , we have $289a+17(-41a+1)+c=10$ or $408a=7+c$ which makes $408a-10=c-3$ . Thus $P(n)=an^2-(41a)n+(408a-10)=0$ . By Vieta's formulas, we know that the sum of the roots( $n$ ) is equal to 41 and the product of the roots( $n$ ) is equal to $408-\frac{10}{a}$ . Because the roots are integers $\frac{10}{a}$ has to be an integer, so $a=1,2,5,10,-1,-2,-5,-10$ . Thus the product of the roots is equal to one of the following: $398,403,406,407,409,410,413,418$ . Testing every potential product of the roots, we find out that the only product that can have divisors that sum up to $41$ is $\boxed{418}$

Answer:  418
Problem: In triangle $ABC, AB=13, BC=15,$ and $CA = 14.$ Point $D$ is on $\overline{BC}$ with $CD=6.$ Point $E$ is on $\overline{BC}$ such that $\angle BAE\cong \angle CAD.$ Given that $BE=\frac pq$ where $p$ and $q$ are relatively prime positive integers, find $q.$

Solution: By the Law of Sines and since $\angle BAE = \angle CAD, \angle BAD = \angle CAE$ , we have
\begin{align*}  \frac{CD \cdot CE}{AC^2} &= \frac{\sin CAD}{\sin ADC} \cdot \frac{\sin CAE}{\sin AEC}  \\ &= \frac{\sin BAE \sin BAD}{\sin ADB \sin AEB} \\ &= \frac{\sin BAE}{\sin AEB} \cdot \frac{\sin BAD}{\sin ADB}\\ &= \frac{BE \cdot BD}{AB^2} \end{align*}
Substituting our knowns, we have $\frac{CE}{BE} = \frac{3 \cdot 14^2}{2 \cdot 13^2} = \frac{BC - BE}{BE} = \frac{15}{BE} - 1 \Longrightarrow BE = \frac{13^2 \cdot 15}{463}$ . The answer is $q = \boxed{463}$

Answer:  463
Problem: In triangle $ABC, AB=13, BC=15,$ and $CA = 14.$ Point $D$ is on $\overline{BC}$ with $CD=6.$ Point $E$ is on $\overline{BC}$ such that $\angle BAE\cong \angle CAD.$ Given that $BE=\frac pq$ where $p$ and $q$ are relatively prime positive integers, find $q.$

Solution: Drop the altitude from A and call the base of the altitude Q. Also, drop the altitudes from E and D to AB and AC respectively. Call the feet of the altitudes R and S respectively.
From here, we can use Heron's Formula to find the altitude. The area of the triangle is $\sqrt{21*6*7*8} = 84$ . We can then use similar triangles with triangle $AQC$ and triangle $DSC$ to find $DS=\frac{24}{5}$ . Consequently, from Pythagorean theorem, $SC = \frac{18}{5}$ and $AS = 14-SC = \frac{52}{5}$ . We can also use the Pythagorean theorem on triangle $AQB$ to determine that $BQ = \frac{33}{5}$
Label $AR$ as $y$ and $RE$ as $x$ $RB$ then equals $13-y$ . Then, we have two similar triangles.
Firstly: $\triangle ARE \sim \triangle ASD$ . From there, we have $\frac{x}{y} = \frac{\frac{24}{5}}{\frac{53}{5}}$
Next: $\triangle BRE \sim \triangle BQA$ . From there, we have $\frac{x}{13-y} = \frac{\frac{56}{5}}{\frac{33}{5}}$
Solve the system to get $x = \frac{2184}{463}$ and $y = \frac{4732}{463}$ .  Notice that 463 is prime, so even though we use the Pythagorean theorem on $x$ and $13-y$ , the denominator won't change. The answer we desire is $\boxed{463}$

Answer:  463
Problem: In triangle $ABC, AB=13, BC=15,$ and $CA = 14.$ Point $D$ is on $\overline{BC}$ with $CD=6.$ Point $E$ is on $\overline{BC}$ such that $\angle BAE\cong \angle CAD.$ Given that $BE=\frac pq$ where $p$ and $q$ are relatively prime positive integers, find $q.$

Solution: Let $\angle CAD = \angle BAE = \theta$ . Note by Law of Sines on $\triangle BEA$ we have \[\frac{BE}{\sin{\theta}} = \frac{AE}{\sin{B}} = \frac{AB}{\sin{\angle BEA}}\] As a result, our goal is to find $\sin{\angle BEA}$ and $\sin{\theta}$ (we already know $AB$ ).
Let the foot of the altitude from $A$ to $BC$ be $H$ . By law of cosines on $\triangle ABC$ we have \[169 = 196 + 225 - 2 \cdot 14 \cdot 15 \cdot \cos{C} \Rightarrow \cos{C} = \frac{3}{5}\] It follows that $AH = \frac{56}{5}$ and $HC = \frac{42}{5} \Rightarrow HD = \frac{12}{5}$
Note that by PT on $\triangle AHD$ we have that $AD^2 = \left(\frac{56}{5}\right)^2 + \left(\frac{12}{5}\right)^2 = \frac{656}{5}$ . By Law of Sines on $\triangle ADC$ (where we square everything to avoid taking the square root) we see \[\frac{36}{\sin^2{\theta}} = \frac{656}{5 \cdot \frac{16}{25}} \Rightarrow \sin^2{\theta} = \frac{36}{205}.\] How are we going to find $\sin{\angle BEA}$ though? $\angle BEA$ and $\theta$ are in the same triangle. Applying Law of Sines on $\triangle ABC$ we see that \[\frac{13}{\frac{4}{5}} = \frac{14}{\sin{\angle B}} \Rightarrow \sin{\angle B} = \frac{56}{65} \Rightarrow \cos{\angle B} = \frac{33}{65}.\] $\theta$ $\angle B$ , and $\angle BEA$ are all in the same triangle. We know they add up to $180^{\circ}$ . There's a good chance we can exploit this using the identity $\sin{p} = \sin{180^{\circ}-p}$
We have that $\sin{(180^{\circ} - (\theta + \angle B))} = \sin{\angle BEA} = \sin{(\theta + \angle B)}$ . Success! We know $\sin{\theta}$ and $\sin{\angle B}$ already. Applying the $\sin$ addition formula we see \[\sin{\theta + \angle B} = \sin{\theta} \cos{\angle B} + \sin{\angle B} \cos{\theta} = \frac{6}{\sqrt{205}} \cdot \frac{33}{65} + \frac{56}{65} \cdot \frac{13}{\sqrt{205}}=\frac{1}{65 \cdot \sqrt{205}} (198 + 728) = \frac{926}{65 \sqrt{205}}.\] This is the last stretch! Applying Law of Sines a final time on $\triangle BEA$ we see \[\frac{BE}{\sin{\theta}} = \frac{13}{\sin{BEA}} \Rightarrow \frac{BE}{\frac{6}{\sqrt{205}}} = \frac{13}{\frac{926}{65\sqrt{205}}} \Rightarrow \frac{BE}{6} = \frac{13 \cdot 65}{926} \Rightarrow \frac{13 \cdot 65 \cdot 6}{926} = BE = \frac{2535}{463}.\] It follows that the answer is $\boxed{463}$

Answer:  463
Problem: In triangle $ABC, AB=13, BC=15,$ and $CA = 14.$ Point $D$ is on $\overline{BC}$ with $CD=6.$ Point $E$ is on $\overline{BC}$ such that $\angle BAE\cong \angle CAD.$ Given that $BE=\frac pq$ where $p$ and $q$ are relatively prime positive integers, find $q.$

Solution: Since $AE$ and $AD$ are isogonal with respect to the $A$ angle bisector, we have \[\frac{BE}{EC}\cdot \frac{BD}{DC}=(\frac{AB}{AC})^2.\] To prove this, let $\angle BAE=\angle DAC=x$ and $\angle BAD=\angle CAE=y.$ Then, by the Ratio Lemma, we have \[\frac{BD}{DC}=\frac{AB\sin y}{AC\sin x}\] \[\frac{BE}{EC}=\frac{AB\sin x}{AC\sin y}\] and multiplying these together proves the formula for isogonal lines. Hence, we have \[\frac{BE}{15-BE}\cdot \frac{9}{6}=\frac{169}{196}\implies BE=\frac{2535}{463}\] so our desired answer is $\boxed{463}.$

Answer:  463
Problem: In triangle $ABC, AB=13, BC=15,$ and $CA = 14.$ Point $D$ is on $\overline{BC}$ with $CD=6.$ Point $E$ is on $\overline{BC}$ such that $\angle BAE\cong \angle CAD.$ Given that $BE=\frac pq$ where $p$ and $q$ are relatively prime positive integers, find $q.$

Solution: Let $ED = x$ , such that $BE = 9-x$ . Since $\overline{AE}$ and $\overline{AD}$ are isogonal, we get $\frac{9-x}{6+x} \cdot \frac{9}{6} = \frac{13^2}{14^2} \Rightarrow 588(9 - x) = 338(6 + x)$ , and we can solve to get $x = \frac{1632}{463}$ (and $BE = \frac{2535}{463}$ ). Hence, our answer is $\boxed{463}$ . - Spacesam

Answer:  463
Problem: In triangle $ABC, AB=13, BC=15,$ and $CA = 14.$ Point $D$ is on $\overline{BC}$ with $CD=6.$ Point $E$ is on $\overline{BC}$ such that $\angle BAE\cong \angle CAD.$ Given that $BE=\frac pq$ where $p$ and $q$ are relatively prime positive integers, find $q.$

Solution: Diagram borrowed from Solution 1.
Applying Law of Cosines on $\bigtriangleup ABC$ with respect to $\angle C$ we have \[AB^2=AC^2+BC^2-2(AC)(BC)\cos C\] Solving gets $\cos C=\frac{3}{5}$ , which implies that \[\sin C=\sqrt{1-\cos C}=\frac{4}{5}\] Applying Stewart's Theorem with cevian $AD$ we have \[(BC)(AD)^2+(BC)(BD)(CD)=(CD)(AB)^2+(BD)(AC)^2\] Solving gets $AD=\frac{4\sqrt{205}}{5}$
Applying Law of Sines on $\bigtriangleup ACD$ to solve for $\sin CAD$ we have \[\frac{AD}{\sin C}=\frac{CD}{\sin CAD}\] Solving gets $\sin CAD=\frac{6\sqrt{205}}{205}$ . Thus $\sin BAE=\sin CAD=\frac{6\sqrt{205}}{205}$
Applying Law of Sines on $\bigtriangleup ABC$ we have \[\frac{AC}{\sin B}=\frac{AB}{\sin C}\] Solving gets $\sin B=\frac{56}{65}$
Applying Stewart's Theorem with cevian $AE$ we have \[(BC)(AE)^2+(BC)(BE)(CE)=(CE)(AB)^2+(BE)(AC)^2\] \[(BC)(AE)^2+(BC)(BE)(BC-BE)=(BC-BE)(AB)^2+(BE)(AC)^2\] Solving gets $AE=\sqrt{\frac{15BE^2-198BE+2535}{15}}$
Finally, applying Law of Sines on $\bigtriangleup BAE$ we have \[\frac{AE}{\sin B}=\frac{BE}{\sin BAE}\] \[\frac{\sqrt{\frac{15BE^2-198BE+2535}{15}}}{\frac{56}{65}}=\frac{BE}{\frac{6\sqrt{205}}{205}}\] \[7605BE^2-32342BE+2535=0\] Solving the easy quadratic equation gets $BE=\frac{1632}{463}\Longrightarrow q=\boxed{463}$

Answer:  463
Problem: In triangle $ABC, AB=13, BC=15,$ and $CA = 14.$ Point $D$ is on $\overline{BC}$ with $CD=6.$ Point $E$ is on $\overline{BC}$ such that $\angle BAE\cong \angle CAD.$ Given that $BE=\frac pq$ where $p$ and $q$ are relatively prime positive integers, find $q.$

Solution: Making perpendicular lines from $D$ to $AC$ , meeting at $N$ ; from $E$ to $AB$ , meeting at $J$ . According to LOC, we can get that $\cos\angle{C}=\frac{3}{5}$ . So we get that $CN=\frac{18}{5};DN=\frac{24}{5};AN=AC-CN=\frac{52}{5}$ . Now we can see that $\tan\angle{DAN}=\frac{DN}{AN}=\frac{6}{13}$ . Now we see that in $\triangle{EJA}$ , assuming $EJ=6x;AJ=13x$ since $\tan\angle{JAE}=\tan\angle{DAN}$ . Now we need to find the tangent of $\angle{B}$ . Making a perpendicular line from $C$ to $AB$ at $M$ . We can see that $CM=\frac{168}{13};AM=\frac{70}{13};BM=AB-AM=13-\frac{70}{13}=\frac{99}{13}$ . We get that $\tan\angle{B}=\frac{56}{33}$ so $BJ=\frac{33}{56}*6x=\frac{99x}{28}$ . 
After getting AJ and BJ, we can get that $AB=AJ+BJ=\frac{463x}{28}=13$ , which means that $x=\frac{364}{463}$ . According to the similarity, $\frac{CM}{BC}=\frac{JE}{BE};BE=\frac{2535}{463}$ which $\boxed{463}$ is our answer
~bluesoul

Answer:  463
Problem: Let $w_1$ and $w_2$ denote the circles $x^2+y^2+10x-24y-87=0$ and $x^2 +y^2-10x-24y+153=0,$ respectively. Let $m$ be the smallest positive value of $a$ for which the line $y=ax$ contains the center of a circle that is externally tangent to $w_2$ and internally tangent to $w_1.$ Given that $m^2=\frac pq,$ where $p$ and $q$ are relatively prime integers, find $p+q.$

Solution: Rewrite the given equations as $(x+5)^2 + (y-12)^2 = 256$ and $(x-5)^2 + (y-12)^2 = 16$
Let $w_3$ have center $(x,y)$ and radius $r$ .  Now, if two circles with radii $r_1$ and $r_2$ are externally tangent, then the distance between their centers is $r_1 + r_2$ , and if they are internally tangent, it is $|r_1 - r_2|$ .  So we have
\begin{align*} r + 4 &= \sqrt{(x-5)^2 + (y-12)^2} \\ 16 - r &= \sqrt{(x+5)^2 + (y-12)^2} \end{align*}
Solving for $r$ in both equations and setting them equal, then simplifying, yields
\begin{align*} 20 - \sqrt{(x+5)^2 + (y-12)^2} &= \sqrt{(x-5)^2 + (y-12)^2} \\ 20+x &= 2\sqrt{(x+5)^2 + (y-12)^2} \end{align*}
Squaring again and canceling yields $1 = \frac{x^2}{100} + \frac{(y-12)^2}{75}.$
So the locus of points that can be the center of the circle with the desired properties is an ellipse
Since the center lies on the line $y = ax$ , we substitute for $y$ and expand: \[1 = \frac{x^2}{100} + \frac{(ax-12)^2}{75} \Longrightarrow (3+4a^2)x^2 - 96ax + 276 = 0.\]
We want the value of $a$ that makes the line $y=ax$ tangent to the ellipse, which will mean that for that choice of $a$ there is only one solution to the most recent equation. But a quadratic has one solution iff its discriminant is $0$ , so $(-96a)^2 - 4(3+4a^2)(276) = 0$
Solving yields $a^2 = \frac{69}{100}$ , so the answer is $\boxed{169}$

Answer:  169
Problem: Let $w_1$ and $w_2$ denote the circles $x^2+y^2+10x-24y-87=0$ and $x^2 +y^2-10x-24y+153=0,$ respectively. Let $m$ be the smallest positive value of $a$ for which the line $y=ax$ contains the center of a circle that is externally tangent to $w_2$ and internally tangent to $w_1.$ Given that $m^2=\frac pq,$ where $p$ and $q$ are relatively prime integers, find $p+q.$

Solution: As above, we rewrite the equations as $(x+5)^2 + (y-12)^2 = 256$ and $(x-5)^2 + (y-12)^2 = 16$ . Let $F_1=(-5,12)$ and $F_2=(5,12)$ . If a circle with center $C=(a,b)$ and radius $r$ is externally tangent to $w_2$ and internally tangent to $w_1$ , then $CF_1=16-r$ and $CF_2=4+r$ . Therefore, $CF_1+CF_2=20$ . In particular, the locus of points $C$ that can be centers of circles must be an ellipse with foci $F_1$ and $F_2$ and major axis $20$
Clearly, the minimum value of the slope $a$ will occur when the line $y=ax$ is tangent to this ellipse. Suppose that this point of tangency is denoted by $T$ , and the line $y=ax$ is denoted by $\ell$ . Then we reflect the ellipse over $\ell$ to a new ellipse with foci $F_1'$ and $F_2'$ as shown below.
By the reflection property of ellipses (i.e., the angle of incidence to a tangent line is equal to the angle of reflection for any path that travels between the foci), we know that $F_1$ $T$ , and $F_2'$ are collinear, and similarly, $F_2$ $T$ and $F_1'$ are collinear. Therefore, $OF_1F_2F_2'F_1'$ is a pentagon with $OF_1=OF_2=OF_1'=OF_2'=13$ $F_1F_2=F_1'F_2'=10$ , and $F_1F_2'=F_1'F_2=20$ . Note that $\ell$ bisects $\angle F_1'OF_1$ . We can bisect this angle by bisecting $\angle F_1'OF_2$ and $F_2OF_1$ separately.
We proceed using complex numbers. Triangle $F_2OF_1'$ is isosceles with side lengths $13,13,20$ . The height of this from the base of $20$ is $\sqrt{69}$ . Therefore, the complex number $\sqrt{69}+10i$ represents the bisection of $\angle F_1'OF_2$
Similarly, using the 5-12-13 triangles, we easily see that $12+5i$ represents the bisection of the angle $F_2OF_1$ . Therefore, we can add these two angles together by multiplying the complex numbers, finding \[\text{arg}\left((\sqrt{69}+10i)(12+5i)\right)=\frac{1}{2}\angle F_1'OF_1.\] Now the point $F_1$ is given by the complex number $-5+12i$ . Therefore, to find a point on line $\ell$ , we simply subtract $\frac{1}{2}\angle F_1'OF_1$ , which is the same as multiplying $-5+12i$ by the conjugate of $(\sqrt{69}+10i)(12+5i)$ . We find \[(-5+12i)(\sqrt{69}-10i)(12-5i)=169(10+i\sqrt{69}).\] In particular, note that the tangent of the argument of this complex number is $\sqrt{69}/10$ , which must be the slope of the tangent line. Hence $a^2=69/100$ , and the answer is $\boxed{169}$

Answer:  169
Problem: Let $w_1$ and $w_2$ denote the circles $x^2+y^2+10x-24y-87=0$ and $x^2 +y^2-10x-24y+153=0,$ respectively. Let $m$ be the smallest positive value of $a$ for which the line $y=ax$ contains the center of a circle that is externally tangent to $w_2$ and internally tangent to $w_1.$ Given that $m^2=\frac pq,$ where $p$ and $q$ are relatively prime integers, find $p+q.$

Solution: We use the same reflection as in Solution 2. As $OF_1'=OF_2=13$ , we know that $\triangle OF_1'F_2$ is isosceles. Hence $\angle F_2F_1'O=\angle F_1'F_2O$ . But by symmetry, we also know that $\angle OF_1T=\angle F_2F_1'O$ . Hence $\angle OF_1T=\angle F_1'F_2O$ . In particular, as $\angle OF_1T=\angle OF_2T$ , this implies that $O, F_1, F_2$ , and $T$ are concyclic.
Let $X$ be the intersection of $F_2F_1'$ with the $x$ -axis. As $F_1F_2$ is parallel to the $x$ -axis, we know that \[\angle TXO=180-\angle F_1F_2T.\tag{1}\] But \[180-\angle F_1F_2T=\angle F_2F_1T+\angle F_1TF_2.\tag{2}\] By the fact that $OF_1F_2T$ is cyclic, \[\angle F_2F_1T=\angle F_2OT\qquad\text{and}\qquad \angle F_1TF_2=\angle F_1OF_2.\tag{3}\] Therefore, combining (1), (2), and (3), we find that \[\angle TXO=\angle F_2OT+\angle F_1OF_2=\angle F_1OT.\tag{4}\]
By symmetry, we also know that \[\angle F_1TO=\angle OTF_1'.\tag{5}\] Therefore, (4) and (5) show by AA similarity that $\triangle F_1OT\sim \triangle OXT$ . Therefore, $\angle XOT=\angle OF_1T$
Now as $OF_1=OF_2'=13$ , we know that $\triangle OF_1F_2'$ is isosceles, and as $F_1F_2'=20$ , we can drop an altitude to $F_1F_2'$ to easily find that $\tan \angle OF_1T=\sqrt{69}/10$ . Therefore, $\tan\angle XOT$ , which is the desired slope, must also be $\sqrt{69}/10$ . As before, we conclude that the answer is $\boxed{169}$

Answer:  169