UVa 591 - Box of Bricks

Summary
Find the minimum number of moves to make all stacks of bricks the same height.

Explanation
This is a simple ad-hoc problem. We first find the final height of the stacks of bricks by computing the average, then add up the difference between the average and the stacks higher than the average.

Gotchas

 * Print a blank line after each set.

Input
6 5 2 4 1 7 5 0

Output
Set #1 The minimum number of moves is 5.

Solutions

 * Code All the Problems

Categories here, use the form , see Categories for a list