When load P is removed

$\Sigma M_A = 0$

$Qx = 20(5 + 1)$

$Qx = 120$ → Equation (1)

When load P is applied

$\Sigma M_B = 0$

$Q(x + 5) = 20(1) + 20(10)$

$Qx + 5Q = 220$

From Equation (1), Qx = 120, thus,

$120 + 5Q = 220$

$5Q = 100$

$Q = 20 \, \text{ tons}$ *answer*

Substitute Q = 20 tons to Equation (1)

$20x = 120$

$x = 6 \, \text{ ft}$ *answer*