Marching Cadets and Dog Problem

In my search for new problems I came across this one from Martin Gardner:

“A square formation of Army cadets, 50 feet on the side, is marching forward at a constant pace [see Figure]. The company mascot, a small terrier, starts at the center of the rear rank [position A in the illustration], trots forward in a straight line to the center of the front rank [position B], then trots back again in a straight line to the center of the rear. At the instant he returns to position A, the cadets have advanced exactly 50 feet. Assuming that the dog trots at a constant speed and loses no time in turning, how many feet does he travel?”

Gardner gives a follow-up problem that is virtually impossible:

“If you solve this problem, which calls for no more than a knowledge of elementary algebra, you may wish to tackle a much more difficult version proposed by the famous puzzlist Sam Loyd. Instead of moving forward and back through the marching cadets, the mascot trots with constant speed around the outside of the square, keeping as close as possible to the square at all times. (For the problem we assume that he trots along the perimeter of the square.) As before, the formation has marched 50 feet by the time the dog returns to point A. How long is the dog’s path?”

Answer.

See the Marching Cadets and Dog Problem for solutions.