干草
#include<iostream>
using namespace std;
const int N = 10010;
int a[N];
int main()
{
int n, sum = 0;
cin >> n;
int are = 0;
for(int i = 1; i <= n; i ++)cin >> a[i], are += a[i];
are /= n;
int ans = 0;
for(int i = 1; i <= n; i ++)
{
ans += abs(a[i] - are);
}
cout << ans / 2 <<endl;
}