this is the shortest possible way.. it can be done using differential calculus or by writing relative distance as a function of time and equating dot product of relative displacement and relative velocity to zero but those methods are very time consuming...