A circle with area $40$ is tangent to a circle with area $10$. Let $R$ be the smallest rectangle containing both circles. The area of $R$ is $\frac{n}{\pi}$. Find $n$.

Let's think step by step and output the final answer within \boxed{}.
user