The problem is as follows:
An homogeneous brass bar which goes from point $A$ to point $B$ has a weight of $300\,N$. The bar is suported over two frictionless surfaces as it is shown in the picture from below. The system is in static equilibrium by the action of the force excerted by the spring tied to the end at point $B$ on the bar which in turn is fixed to the ceiling. Using this information find the elongation of the spring. Assume that the constant of the spring is $k=500\,\frac{N}{m}$.
The alternatives given in my book are as follows:
$\begin{array}{ll} 1.&28\,cm\\ 2.&23\,cm\\ 3.&25\,cm\\ 4.&26\,cm\\ 5.&30\,cm\\ \end{array}$
What I did to solve this problem was to use a "trick" which I seen in a similar problem about a ladder standing next to a wall.
The rationale was that when an horizontal object is leaning against two surfaces there will be a reaction from both. But if it is asked a force in between. You may use any point to establish the torque about that point and use Varignon's theorem? to find the unknown force. This is done to "cancel out" the reaction force from both surfaces.
Therefore:
Torque about the point specified in the figure from below results into:
$\sum_{i=1}^{n}\tau=0$
$(l\cos 30^{\circ})\times(300)+500\times x \times 2l =0$
simplifying terms:
$-\frac{\sqrt {3}}{2}\times 3 + 10 x = 0$
$x= \frac{3 \sqrt {3}}{20}\approx .2598076212 \,m$
which transformed into cm would be about $26\,cm$ and this appears in the alternatives as option four. But is my answer the right approach to this problem?.
My source of confusion is that in the problem is not indicated if the spring is paralell to the incline or if it does make another angle.
It is not indicated in the problem but how can I find let's say the Reaction in both the floor and in the wall?. How can I find these?. Am I using Varignon's theorem in this problem?. Can someone help me with this matter please?.


Calling $\alpha = 30^{\circ},\ \beta = 60^{\circ}$ and
$$ \cases{ A=(0,0)\\ B=A+l(\cos\alpha,\sin\alpha)\\ G = \frac 12\left(B+A\right) } $$
with the forces
$$ \cases{ f_A = (0,N_A)\\ f_B = k \Delta x (\cos\beta,\sin\beta)+N_B(-\cos\alpha,\sin\alpha)\\ f_G = (0,-W) } $$
we have
$$ \cases{ f_A+f_B+f_G = 0\\ (A-B)\times f_A+(G-B)\times f_G = 0 } $$
from which we obtain
$$ N_A = \frac W2,\ N_B = \frac W4,\ \Delta x = \frac{\sqrt{3}W}{4k} $$
so $\Delta x\approx 0.26$ cm
Another way using virtual displacements.
Calling
$$ \cases{ f_{B_1} = k \Delta x (\cos\beta,\sin\beta)\\ f_{B_2} = N_B(-\cos\alpha,\sin\alpha) } $$
In equilibrium, we have
$$ \delta A\cdot f_A + \delta G\cdot f_G + \delta B \cdot\left(f_{B_1}+f_{B_2}\right) = 0 $$
and due to orthogonality
$$ \delta A\cdot f_A = \delta A\cdot f_G = \delta B\cdot f_{B_2} = 0 $$
and following
$$ \frac 12\left(\delta A + \Delta x(\cos\beta,\sin\beta)\right)\cdot f_G + k (\Delta x)^2\left(\cos\beta,\sin\beta\right)\cdot \left(\cos\beta,\sin\beta\right)=0 $$
or
$$ -\frac 12 W\sin\beta + k\Delta x = 0\Rightarrow \Delta x = \frac{\sqrt{3}W}{4k} $$