In a perfectly inelastic collision, the colliding particles stick together.

Assume there are two particles with mass and velocity as m_1, \vec{v_1} and m_2,\vec{v_2}
If the velocity after the collision is \vec{u}
From conservation of momentum, m_1\vec{v_1}+m_2 \vec{v_2}=(m_1+m_2)\vec{u}
So \vec{u}=\frac{m_1\vec{v_1}+m_2 \vec{v_2}}{m_1+m_2}=V_{cm}

Energy loss due to collision is
\Delta k=\frac{1}{2}m_1 \vec{v}_1^2 +\frac{1}{2}m_2 \vec{v}_2^2 -\frac{1}{2} (m_1+m_2) \vec{u}^2=\frac{1}{2}\frac{m_1m_2}{m_1+m_2}(\vec{v}_1-\vec{v}_2)^2