How to find velocity in inelastic collision?