Square $AIME$ has sides of length $10$ units. Isosceles triangle $GEM$ has base $EM$, and the area common to triangle $GEM$ and square $AIME$ is $80$ square units. Find the length of the altitude to $EM$ in $\triangle GEM$.
If the altitude $h$ were at most $10$, the overlap would be the whole triangle with area at most $50$. So $h>10$ and $G$ lies outside the square.
The overlap is the triangle minus the small similar triangle beyond side $AI$, so $5h-5h\left(\frac{h-10}h\right)^2=80$, i.e.\ $5h^2-5(h-10)^2=80h$, so $100h-500=80h$.
Square $AIME$ has sides of length $12$ units. Isosceles triangle $GEM$ has base $EM$, and the area common to triangle $GEM$ and square $AIME$ is $120$ square units. Find the length of the altitude to $EM$ in $\triangle GEM$.