Distance = speed x time (D=vt) Let R=Ryan's speed. Ryan drove 5 hrs. Gabe drives only 2 hours to get just as far. So their distances are equal in the end. So then using D=vt for each distance and setting them equal:
5R=2(R+42)
5R=2R+84
3R=84
R=28km/hr