#1867: 觀念建立好


qwer12343 (風中細雨)


#include<iostream>
using namespace std;
int main(){
    int a[100], n, b, c, j, t=0;
    while(cin>>n){
      if(n==0)break;
      for(j=0;j<n;j++)
        cin>>a[j];
      b=0;
      for(j=0;j<n;j++) b+=a[j];
      b=b/n;
      c=0;
      for(j=0;j<n;j++)
        if(a[j]>b)c+=(a[j]-b);
      cout<<"Set #" <<++t<<endl;
      cout<<"The minimum number of moves is "<<c<<"."<<endl;
    }
    return 0;
}