Problem 59: (2003 AIME I, 7)
Point $B$ is on $\overline{AC}$ with $AB = 9$ and $BC = 21.$ Point $D$ is not on $\overline{AC}$ so that $AD = CD,$ and $AD$ and $BD$ are integers. Let $s$ be the sum of all possible perimeters of $\triangle ACD.$ Find $s.$
- $D$ lies above the midpoint $M$ of $AC$; $AM=15$ and $BM=6$. With $AD=x$, $BD=y$ and height $h$, $x^2-225=h^2=y^2-36$, so $(x-y)(x+y)=189$.
- Factor pairs give $(x,y)=(95,94),(33,30),(17,10),(15,6)$; the last has $h=0$.
- Perimeters $2x+30$ sum to $220+96+64=380$. The answer is $\boxed{380}$.
Point $B$ is on $\overline{AC}$ with $AB = 11$ and $BC = 19.$ Point $D$ is not on $\overline{AC}$ so that $AD = CD,$ and $AD$ and $BD$ are integers. Let $s$ be the sum of all possible perimeters of $\triangle ACD.$ Find $s.$