Answer:
5 miles
Step-by-step explanation:
The Pythagoras theorem : a² + b² = c²
where a = length = 4
b = base= 3
c = hypotenuse
4² + 3²
16 + 9 = 25
√25 = 5
4, 5, and 7 are mutually coprime, so you can use the Chinese remainder theorem right away.
We construct a number
such that taking it mod 4, 5, and 7 leaves the desired remainders:

- Taken mod 4, the last two terms vanish and we have

so we multiply the first term by 3.
- Taken mod 5, the first and last terms vanish and we have

so we multiply the second term by 2.
- Taken mod 7, the first two terms vanish and we have

so we multiply the last term by 7.
Now,

By the CRT, the system of congruences has a general solution

or all integers
,
, the least (and positive) of which is 27.