The radio waves travel at speed of light:

The distance of Mars from Earth when it is at the farthest point is:

And since the motion of the radio waves is a uniform motion, we can use the basic relationship between velocity, space and time to find the time the waves take to reach Mars:
