Plane A 520 feet vertical rise 40 feet/min
plane B 3800 feet vertical dip 120 feet per minute.
vertically the speeds are 40 feet / minute & 120 feet /minute.
120 + 40 = 160 feet per minute.
the distance between them = 3800 -520 =3280 feet
t= d/r
3280/160
t = 20.5 minutes. they will be at the same altitude.