Hi, here's a problem that I have difficulty with to solve.

Block M2, w/c has a 20 kg mass, is on a frictionless table and it is firmly attached to one end of a spring with k = 2.5 N/m. The other end of the spring is anchored to the wall. Another block, M1 (and of the same mass as M2), is thrown horizontally toward M2 with a speed of 0.8 m/s.

For the elastic situation:
1) Calculate the final energy after the two masses collide
2) By how much is M2 compressed?
3) Describe the motion after M1 collides with M2

For inelastic situation:
1) Find the final velocity after the collision
2) Find the final momentum of the collision