First consider the free body diagram of block Q, From the fig.(b)
2T = Q, T = Q/2
i.e tension in the rope = Q/2
Now consider the F.B.D. of the beam as shown in fig(c) Here two forces are acting force ‘P’ at a distance ‘X’ from point ‘A’ and T = Q/2 at a distance ‘l’ from point ‘A’
Taking moment about point ‘A’, i.e. ∑MA = 0
P X x = Q/2 X l
X = QL/2p.