CANDY - Candy I

题意翻译

詹妮弗是小学一年级的老师。她今天和同学们去旅游了,并为每一位同学带了一包糖果。不幸的是,每个糖果包里的糖果数目是不相同的。 詹妮弗很害怕每个孩子都想得到最大的糖果包,导致孩子们争吵甚至打架。 她想避免这种情况发生。因此,她打算打开所有的糖果包,数出每个糖果包里的糖果数,并把一些糖果从较大的糖果包移动到较小的糖果包里。问题是:她最少需要移动多少颗糖果?

题目描述

Jennifer is a teacher in the first year of a primary school. She has gone for a trip with her class today. She has taken a packet of candies for each child. Unfortunatelly, the sizes of the packets are not the same. Jennifer is afraid that each child will want to have the biggest packet of candies and this will lead to quarrels or even fights among children. She wants to avoid this. Therefore, she has decided to open all the packets, count the candies in each packet and move some candies from bigger packets to smaller ones so that each packet will contain the same number of candies. The question is how many candies she has to move.

输入输出格式

输入格式


输出格式


输入输出样例

输入样例 #1

file:
5
1
1
1
1
6
2
3
4
-1

输出样例 #1

file:
4
-1