1. The problem statement, all variables and given/known data
A small block of mass m is moving on a horizontal table surface at initial speed v0. It then moves smoothly onto a sloped big block of mass M. The big block can also move on the table surface. Assume that everything moves without friction

Find the speed v of the small block after it leaves the slope.

2. Relevant equations
Conservation of Momentum: mv0 = (M+m)v → v=(mv0)/(M+m)
Conservation of Mechanical Energy: fairly obvious
The height that it rises to is h = (1/2g)(Mv0^2/M+m), I derived this from conservation of momentum and conservation of mechanical energy 3. The attempt at a solution
I set up the conservation of momentum: (M + m)v = -mv1 + Mv2 Is this correct?
Now I ask, how should I set up the conservation of mechanical energy equation? Should I solve for one variable in terms of the other? The answer should be in terms of v0.

How would a conservation of kinetic energy equation look like?

1/2(M+m)v^2 = 1/2mv1^2 + 1/2Mv2^2 ?

Conservation of momentum: (M+m)v = -mv1 + Mv2 ?

If I solve for v1 using these equations, it turns out very convoluted and does not resemble the answer. I feel as though it should be cleaner than this. Am I doing something incorrectly?