I'm solving a problem that reads
"Two cars collide with masses $m_1=m_2=140\,$kg with perpendicular velocities $v_1=3.6\,$m/s and $v_2=7.2\,$m/s. After the collision they keep going at a common velocity $v_3.$ Calculate $v_3$.”
Now I used the momentum formula and arrive at $v_3 = \frac{m_1v_1+m_2v_2}{m_1+m_2}$ which gives me $5.4\,$m/s. However the solutions also say the formula above but then in the next step the formula changes to $v_3 = \frac{\sqrt{m_1^2v_1^2+m_2^2v_2^2}}{m_1+m_2}.$ Why did they square the masses and velocity and root the sum? I've also solved these types of problems in the past and the first equation I wrote worked just fine. Does it have to do with the fact the collision is at an angle or is it for another reason?