In a legislative assembly election, a political group hired a public relations firm to promote its candidate in three ways: telephone, house calls, and letters. The cost per contact (in paise) is given in matrix $A$ as
$A = \left[ {\begin{array}{*{20}{c}}
{\mathrm {Cost\,\,per\,\,contact}} \\
{40} \\
{100} \\
{50}
\end{array}} \right]\begin{array}{*{20}{l}}
{{\text{ Telephone }}} \\
{{\text{ Housecall }}} \\
{{\text{ Letter }}}
\end{array}$
The number of contacts of each type made in two cities $\mathrm{X}$ and $\mathrm{Y}$ is given by
$B=$$\,\left[ {\begin{array}{*{20}{c}}
{\mathrm {Telephone}}&{\mathrm {Housecall}}&{\mathrm {Letter}} \\
{1000}&{500}&{5000} \\
{3000}&{1000}&{10,000}
\end{array}} \right]\,$ $\begin{array}{*{20}{c}}
{} \\
{ \to X} \\
{ \to \,Y}
\end{array}$. Find the total amount spent by the group in the two cities $\mathrm{X}$ and $\mathrm{Y}$.