12. Answer: 5
Solution. Choose a point $N$ on $D A$ such that $N A=M A=x$.

It is clear that $\triangle N A E$ and $\triangle M A E$ are congruent by SAS test. Let $S$ be the area of $\triangle N A E$. Then area of $\triangle D N E=\frac{20-x}{x} S$. It is also clear that areas of $\triangle D A E$ and $\triangle C E M$ are equal to $40 \mathrm{~cm}^{2}$. It follows that
$$
\text { Area of } \triangle D A E=\frac{20-x}{x} S+S=\frac{20}{x} S \text {, }
$$
so that $\frac{20}{x} S=40 \mathrm{~cm}^{2}$, that is, $S=2 x$.
Area of $\triangle D A M=\frac{1}{2} \times x \times 20=10 x$. On the other hand,
$$
\text { Area of } \begin{aligned}
\triangle D A M & =\text { Area of } \triangle D A E+\text { Area of } \triangle A E M \\
& =\frac{20}{x} S+S \\
& =\frac{20+x}{x} S=\frac{20+x}{x} \times 2 x=2(20+x) .
\end{aligned}
$$

So $2(20+x)=10 x$, which means that $A M=x=5 \mathrm{~cm}$.
12. In the figure below, $A B C D$ is a square with $A B=20 \mathrm{~cm}$ (not drawn to scale). Assume that $M$ is a point such that the area of the shaded region is $40 \mathrm{~cm}^{2}$. Find $A M$ in centimetres.