Answer
$x_m = 2.4 \,\text{cm}$
Work Step by Step
We could calculate the spring constant by
\begin{align*}
k=4 \pi^{2} \,\dfrac{m_{2}}{ T^{2}} = 4 \pi^{2} \,\dfrac{ 2 \,\text{kg}}{ (20\times 10^{-3} \,\text{s})^{2}} = 1.97 \times 10^{5} \,\text{N/m}
\end{align*}
Time of the collision $t$ equals one-fourth of period $T$
$$t = \dfrac{1}{4} T$$
Therefore, $\omega$ is
$$ \omega = \dfrac{2\pi}{ T} = \dfrac{2\pi}{ 4 t} = \dfrac{\pi}{ 2 t} $$
Substitute with $\omega$ into the equation of the equilibrium position
\begin{align*}
x&=(1 ) \cos (\omega t+\dfrac{\pi}{ 2 } ) = (1) \cos (\dfrac{\pi}{ 2 } +\dfrac{\pi}{ 2 }) = - 1 \mathrm{cm}
\end{align*}
From the conservation law of energy, we find the velocity $v_2$ by
\begin{gather*}
m_1 v_1 = (m_1 +m_2) v_2 \\
v_2 = \left(\dfrac{m_1}{m_1+ m_2}\right) v_1 \\
v_2 = \left(\dfrac{4 \,\text{kg} }{4 \,\text{kg} + 2 \,\text{kg}}\right) (6 \,\text{m/s})\\
v_2 = 4 \,\text{m/s}
\end{gather*}
The mechanical energy $E$ is the summation of both energies $K$ and $U$ and $M = m_1+m_2 = 6 \,\text{kg}$
\begin{align*}
E &= \frac{1}{2} M v^{2} + \frac{1}{2} k x^{2} \\
&= \frac{1}{2} ( 6 \,\text{kg}) ( 4 \,\text{m/s})^{2} + \frac{1}{2} (1.97 \times 10^{5} \,\text{N/m}) (0.01 \,\text{m})^{2}\\
&= 58 \,\text{J}
\end{align*}
Using this value of $E$ we could get the amplitude $x_m$ by
\begin{align*}
x_m=\sqrt{\frac{2 E}{k}} = \sqrt{\frac{2 (58 \,\text{J})}{1.97 \times 10^{5} \,\text{N/m}}} = \boxed{2.4 \mathrm{~cm} }
\end{align*}