Answer
See the detailed answer below.
Work Step by Step
$$\color{blue}{\bf [a]}$$
We have here a net horizontal force exerted on a charge $q$ while the net vertical force is zero. The two horizontal components of the two forces are equal since there is 2 in front of the first formula.
Both forces are at 30$^\circ$ but one of them is counterclockwise with respect to the $+x$-direction and the other is clockwise.
Now we can imagine two identical charges of $q_1=q_2=1\;\rm nC$ affecting a third unknown charge $q$.
The distance between these two identical charges is 4 cm. And we are not given the distance between these two charges and $q$.
Here is the problem text:
From the data in the figure below, find $q$.
$$\color{blue}{\bf [b]}$$
Solving the given formula for $q$;
$$q=\dfrac{(5\times 10^{-5})\left( \dfrac{0.02}{\sin30^\circ} \right)^2}{2(9\times 10^9)(1\times 10^{-9})\cos30^\circ}$$
$$q=\color{red}{\bf 5.1}\;\rm nC$$