(a) Due to the gravitational force on the blocks that's will equal the spring force
So,
$$kx = (m_1+m_2)g sin \theta$$
So,
$$x = \dfrac{(m_1+m_2)gsin \theta}{k}$$
Now,
(b) The blocks are further pushed $$\dfrac{2}{k}(m_1+m_2)g sin \theta$$
So, Total compression = $$\dfrac{2}{k}(m_1+m_2)g sin \theta$$
That means that The amplitude of the SHM followed will be $$\dfrac{2}{k}(m_1+m_2)g sin \theta$$
And, after the total compression in the spring will become zero that is the spring comes to it's natural length , then the blocks will leave each other's contact.
(c) By work energy theorem,
Change in Kinetic Energy = Work done by all forces,
So,
$$\dfrac{1}{2} \times (m_1+m_2) \times v^2 = \dfrac{1}{2}kx^2 - (m_1+m_2)gsin\ theta \times x$$
Therefore,
$$\dfrac{1}{2}(m_1+m_2)v^2 = \dfrac{1}{2}k{\dfrac{3}{k}(m_1+m_2)g sin \theta}^2 - (m_1+m_2)g sin \theta \times \dfrac{3}{k} (m_1+m_2) g sin \theta$$
So,
$$\Rightarrow$$ $$v = g sin \theta \sqrt{\dfrac{3(m_1+m_2)}{k}}$$