Let $m_1 = 2$ kg, $m_2 = 4$ kg, and the distance between them $d = 3$ m.
The center of mass (COM) lies closer to the heavier mass. Let the distance of $m_1$ from COM be $x_1$ and $m_2$ from COM be $x_2$, then:\
$m_1 x_1 = m_2 x_2$, and $x_1 + x_2 = 3$
So, $2x_1 = 4x_2$ ⇒ $x_1 = 2x_2$ ⇒ $2x_2 + x_2 = 3$ ⇒ $x_2 = 1$ m, $x_1 = 2$ m
Now, $I = m_1 x_1^2 + m_2 x_2^2 = 2 \times (2)^2 + 4 \times (1)^2 = 8 + 4 = 12$ kg m$^2$
Converting to standard form: $12 \times 10^3$ g cm$^2$ = $12 \times 10^3$ kg m$^2$