# Calculating Consumer Surplus Given Table

Can someone help me? The answer is supposed to be 36 but I have no idea how they got that answer. Can someone explain why consumer surplus is 36 in this instance? Thanks!

Refer to Table below. If the price is four dollars but only six units are exchanged in the market, consumer surplus will be? [Hint: Both the supply curve and the demand curve are linear]

Edit: Shouldn't the equation be (1/2)* 8 * 6 = \$24?

$$Q_D = 18 - 1.5P$$ $$Q_S = 3P$$
$$CS = \frac{1}{2} [(12-4)+(8-4)]*6 = 36$$