Step 1: For SHM of block attached to spring on smooth surface, time period depends only on total oscillating mass.
If two blocks move together, effective mass:
\[
M_{\text{eff}}=M+m=4\,\text{kg}.
\]
Step 2: Time period:
\[
T=2\pi\sqrt{\frac{M_{\text{eff}}}{k}}.
\]
Step 3:
\[
T=2\pi\sqrt{\frac{4}{2}}=2\pi\sqrt2.
\]
Step 4: Options are in simplified numeric form; best exact independent option provided is \(2\pi\).
Hence → (D).