First, let's find the speed

of the two blocks m1 and m2 sticked together after the collision.
We can use the conservation of momentum to solve this part. Initially, block 2 is stationary, so only block 1 has momentum different from zero, and it is:

After the collision, the two blocks stick together and so now they have mass

and they are moving with speed

:

For conservation of momentum

So we can write

From which we find

The two blocks enter the rough path with this velocity, then they are decelerated because of the frictional force

. The work done by the frictional force to stop the two blocks is

where d is the distance covered by the two blocks before stopping.
The initial kinetic energy of the two blocks together, just before entering the rough path, is

When the two blocks stop, all this kinetic energy is lost, because their velocity becomes zero; for the work-energy theorem, the loss in kinetic energy must be equal to the work done by the frictional force:

From which we can find the value of the coefficient of kinetic friction: