In one side of a hall there are 2N rooms numbered from 1 to 2N. In each room i between 1 and N there are pi beds. Is needed to move every one of this beds to the roms from N+1 to 2N, in such a way that for every j between N+1 and 2N the room j will have pj beds. Supose that each bed can be move once and the price of moving a bed from room i to room j is (i−j)2.
Find a way to move every bed such that the total cost is minimize.Note: The numbers pi are given and satisfy that p1+p2+⋯+pN=pN+1+pN+2+⋯+p2N.
CIIM 2010CIIMundergraduate