2.9 Box of Bricks
2.9.1 时空限制
Time limit: 1 Seconds Memory limit: 32768K
2.9.2 题目内容
Little Bob likes playing with his box of bricks. He puts the bricks one upon another and builds stacks of different height. “Look, I’ve built a wall!” he tells his older sister Alice. “Nah, you should make all stacks the same height. Then you would have a real wall.” she retorts. After a little consideration, Bob sees that she is right. So he sets out to rearrange the bricks, one by one, such that all stacks are the same height afterwards. But since Bob is lazy he wants to do this with the minimum number of bricks moved. Can you help?
![](https://i-blog.csdnimg.cn/blog_migrate/2793650645b55c9aee3fcab50032ddfc.png)
Input
The input cons