First, calculate the initial momentum of the larger cart:
Then, since the larger one gave all its momentum to the smaller one, we can state that