Description: A playground is divided into a grid of n soldiers stood scattered on the grid points. Grid points by integer coordinates (x, y). Soldiers along the grid the edge, down, left, and right step, but only one soldier at the same time any one grid point. In accordance with the commands of officers, soldiers to be neatly fitted to a level queue, ie, arranged in the (x, y), (x+1, y), ..., (x+n-1, y). How to select the x and y values to make the soldiers arranged in a minimum of the total number of moves.
To Search:
File list (Check if you may need any files):
soldier.doc