Let $x$ bricks be transported from $P$ to $A$ and y bricks be transported from $P$ to $B$.
Therefore, $30000-(x+y)$ will be transported to $C$.
Also, (15000-x) bricks, ( $20000-y)$ bricks and $(15000-(30000-(x+y)))$ bricks will be transported to A, B, C from $Q$.
$\therefore$ According to the question,
$x \geq 0, y \geq 0, x+y \leq 30000, x \leq 15000, y \leq 20000, x+y \geq 15000$
Minimize $Z=0.04 x+0.02(15000-x)+0.02 y+0.06(20000-y)+0.03(30000-(x+y))+0.04((x+y)-$ 15000)
$Z=0.03 x-0.03 y+1800$
The feasible region represented by $x \geq 0, y \geq 0, x+y \leq 30000, x \leq 15000, y \leq 20000, x+y \geq 15000$ is given by
The corner points of feasible region are $A(0,15000), B(0,20000), C(10000,20000), D(15000,15000)$, $E(15000,0)$
$$
\begin{tabular}{|l|l|l|}
\hline Corner Point & $\mathrm{Z}=0.03 \mathrm{x}-0.03 \mathrm{y}+1800$ & \\
\hline $\mathrm{A}(0,15000)$ & 1350 & \\
\hline $\mathrm{B}(0,20000)$ & 1200 & \\
\hline $\mathrm{C}(10000,20000)$ & 1500 & \\
\hline $\mathrm{D}(15000,15000)$ & 1800 & \\
\hline $\mathrm{E}(15000,0)$ & 2250 & \\
\hline
\end{tabular}
$$
The minimum value of $Z$ is 1200 at point $(0,20000)$.
Hence, $0,20000,10000$ bricks should be transported from P to A, B, C and $15000,0,5000$ bricks shoull transported from $Q$ to $A, B, C$.