Solution (source code)

= Solution

Choose particle 1's incoming <velocity> positive and particle 2's negative. The final particle is stationary, so <four-momentum conservation> requires zero total incoming <momentum>:
$$
m\gamma_1v_1-2m\gamma_2\frac c3=0,\qquad
\gamma_2=\frac3{2\sqrt2}.
$$
It follows that $\gamma_1\beta_1=1/\sqrt2$. Squaring gives $\beta_1^2/(1-\beta_1^2)=1/2$, hence
$$
\boxed{v_1=\frac c{\sqrt3},\qquad \gamma_1=\sqrt{\frac32}.}
$$
The initial total <energy> becomes the final <rest energy>. Therefore
$$
Mc^2=mc^2\gamma_1+2mc^2\gamma_2,
\qquad\boxed{M=\frac{3+\sqrt3}{\sqrt2}\,m\simeq3.346m.}
$$
The extra <invariant mass> is the incoming <kinetic energy> retained as internal <energy> of the merged particle: $(M-3m)c^2$. It does not violate <conservation of energy> or <four-momentum conservation>; the sum of the separate <rest masses> is not a conserved quantity in an <inelastic collision>.