Box of Bricks

No attempts yetTime limit1sMemory limit128 MB

Problem

Little Bob likes playing with his box of bricks. He puts the bricks one on top of another and builds stacks of different heights. "Look, I've built a wall!", he tells his older sister Alice. "No, you should make all the stacks the same height. Then you would have a real wall.", she replies. After thinking for a moment, Bob sees that she is right. So he sets out to rearrange the bricks, one by one, so that all the stacks end up the same height. But since Bob is lazy, he wants to do this by moving as few bricks as possible. Can you help him?

Input

The input consists of several data sets. Each set begins with a line containing the number $n$ of stacks Bob has built. The next line contains $n$ integers, the heights $h_i$ of the $n$ stacks. You may assume $1 \le n \le 50$ and $1 \le h_i \le 100$.

The total number of bricks is always divisible by the number of stacks, so it is always possible to rearrange the bricks so that all stacks have the same height.

The input is terminated by a set that starts with $n = 0$. This set should not be processed.

Output

For each data set, first print the set number in the form Set #k (as in the sample output, with $k$ starting from $1$). Then print a line The minimum number of moves is k., where $k$ is the minimum number of bricks that must be moved to make all the stacks the same height.

Print a single blank line between consecutive data sets.