The diagram shows twenty congruent [circles](https://artofproblemsolving.com/wiki/index.php/Circle) arranged in three rows and enclosed in a rectangle. The circles are tangent to one another and to the sides of the rectangle as shown in the diagram. The [ratio](https://artofproblemsolving.com/wiki/index.php/Ratio) of the longer dimension of the rectangle to the shorter dimension can be written as $\dfrac{1}{2}(\sqrt{p}-q)$ where $p$ and $q$ are positive integers. Find $p+q$.

[AIME 2002I Problem 02.png](https://artofproblemsolving.com/wiki/index.php/File:AIME_2002I_Problem_02.png)
Let the [radius](https://artofproblemsolving.com/wiki/index.php/Radius) of the circles be $r$. The longer dimension of the rectangle can be written as $14r$, and by the [Pythagorean Theorem](https://artofproblemsolving.com/wiki/index.php/Pythagorean_Theorem), we find that the shorter dimension is $2r\left(\sqrt{3}+1\right)$.
Therefore, $\frac{14r}{2r\left(\sqrt{3}+1\right)}= \frac{7}{\sqrt{3} + 1} \cdot \left[\frac{\sqrt{3}-1}{\sqrt{3}-1}\right] = \frac{1}{2}\left(7\sqrt{3} - 7\right) = \frac{1}{2}\left(\sqrt{p}-q\right)$. Thus we have $p=147$ and $q=7$, so $p+q=\boxed{154}$.