Let one of them be x and the other be represented by an algebraic expression containing X.
Display time = distance/sum of two speeds (problem encountered)
Time = distance/difference between two speeds (catch-up problem)
Solve with a known quantity.
I hope my answer is helpful to you!