Answer
$\approx 1.6\;\rm Hz$
Work Step by Step
First, we need to sketch the spring and the block as we see below. We also need to draw the force diagram exerted on the blocks in both cases as shown below.
The net force exerted on the first block is zero, so
$$kx_1=mg\tag 1$$
where $x_1$ is the stretched distance by the spring.
And the net force exerted on the two blocks is zero as well, so
$$kx =2mg$$
where $x=x_1+x_2$ whereas $x_2=5$ cm, thus
$$k(x_1+0.05) =2mg\tag 2$$
Divide (2) by (1)
$$\dfrac{k(x_1+0.05) }{kx_1}=\dfrac{2mg}{mg}$$
$$\dfrac{x_1+0.05 }{ x_1}=2$$
Hence,
$$2x_1-x_1=0.05$$
$$x_1=\bf 0.05\;\rm m$$
Thus, plugging into (2) and solving for $k$;
$$k=\dfrac{2mg}{(0.05+0.05)}=20mg\tag3$$
The frequency of the two blocks is given by
$$\omega=2\pi f=\sqrt{\dfrac{k}{2m}}$$
Plugging from (3):
$$ f=\dfrac{1}{2\pi}\sqrt{\dfrac{20mg}{2m}}=\dfrac{1}{2\pi}\sqrt{10g}$$
$$f=\dfrac{1}{2\pi}\sqrt{10(9.8)}=\color{red}{\bf 1.57}\;\rm Hz$$