A linear army of people that is miles long walks miles while a horseman gallops from the back of the line to the front and then gallops to the back again. How far (in miles) has the horseman travelled? The answer is in the form for integers and with maximal. Find .