Mark's rate is 1 task/m hours and for both Sam & Mark, the rate is 1 task/t hours
We don't know Sam's rate, so let's use x as his rate
Working together (Mark) 1 task/m hours + (Sam) 1 task/x hours = 1 task/t hours
This implies 1/m + 1/x = 1/t Solving for x = tm/(m-t) hours/task and we know t<m