Let's introduce 4 - vector p μ = ( E c , p ⃗ ) p_\mu = (\frac{E}{c},\vec p) p μ  = ( c E  , p  )  , p μ p μ = ( E c ) 2 − ( p ⃗ ) 2 = m 2 c 2 p^\mu p_\mu = \left(\frac{E}{c}\right)^2-(\vec p)^2 = m^2c^2 p μ p μ  = ( c E  ) 2 − ( p  ) 2 = m 2 c 2    
p μ 1 = ( E 1 c , p ⃗ 1 ) ; p μ 2 = ( E 2 c , p ⃗ 2 ) ; P μ = ( E c , P ⃗ ) p^{1}_\mu = (\frac{E_1}{c},\vec p_1) 
;p^{2}_\mu =(\frac{E_2}{c},\vec p_2);P_\mu =(\frac{E}{c},\vec P) p μ 1  = ( c E 1   , p  1  ) ; p μ 2  = ( c E 2   , p  2  ) ; P μ  = ( c E  , P )   
where P μ P_\mu P μ     - 4 - vector of momentum of the body M M M   
p μ 1 , p μ 2 p^1_\mu, p^2_\mu p μ 1  , p μ 2     - 4 - vector of momentum of the m 1 , m 2 m_1, m_2 m 1  , m 2    
We know that  P ⃗ = 0 \vec P = 0 P = 0  . Also we know that momentum and energy conserve laws are done in this case. So, we have the system of equations:
P ⃗ = p ⃗ 1 + p ⃗ 2 = 0 ; \vec P = \vec p^1 + \vec p^2 = 0; P = p  1 + p  2 = 0 ;   
( E c ) 2 = M 2 c 2 \left(\frac{E}{c}\right)^2 = M^2c^2 ( c E  ) 2 = M 2 c 2   
( E 1 c ) 2 − ( p ⃗ 1 ) 2 = m 1 2 c 2 \left(\frac{E_1}{c}\right)^2-(\vec p^1)^2 = m_1^2c^2 ( c E 1   ) 2 − ( p  1 ) 2 = m 1 2  c 2   
( E 2 c ) 2 − ( p ⃗ 2 ) 2 = m 2 2 c 2 \left(\frac{E_2}{c}\right)^2-(\vec p^2)^2 = m_2^2c^2 ( c E 2   ) 2 − ( p  2 ) 2 = m 2 2  c 2   
We can solve this system relatively by the energies E 1 , E 2 E_1,E_2 E 1  , E 2    and get the answer on this question.
E 1 = c 2 M 2 + m 1 2 − m 2 2 2 M E_1 = c^2\frac{M^2+m^2_1-m^{2}_2}{2M} E 1  = c 2 2 M M 2 + m 1 2  − m 2 2     
                             
Comments
Thanks sir for the answer. But which photo I have to follow ? I can't see any photo here