#include <iostream> using namespace std; int main() { int a[51],n,k=1; while(cin>>n,n) { int i,ans=0,s=0; for(i=0;i<n;i++) { cin>>a[i]; s+=a[i]; } s/=n; for(i=0;i<n;i++) if(a[i]>s)ans+=a[i]-s; cout<<"Set #"<<k++<<endl; cout<<"The minimum number of moves is "<<ans<<'.'<<endl<<endl; } return 0; }
#include <iostream>
using namespace std;
int main()
{
int a[51],n,k=1;
while(cin>>n,n)
{
int i,ans=0,s=0;
for(i=0;i<n;i++)
{
cin>>a[i];
s+=a[i];
}
s/=n;
for(i=0;i<n;i++)
if(a[i]>s)ans+=a[i]-s;
cout<<"Set #"<<k++<<endl;
cout<<"The minimum number of moves is "<<ans<<'.'<<endl<<endl;
}
return 0;
}