Trick here is to write the velocities in component form.
be the velocity of first particle.
be the velocity of second particle.
Since the vertical component of initial velocity is
for both the particles, we have
We want to know the time at which the velocities are perpendicular, so simply set the dot product of velocities equal to