typedeflonglong LL; constint maxn = 55; int a[maxn];
intmain(){ int n, t = 0; while (~scanf("%d", &n) && n) { int sum = 0; for (int i = 0; i < n; ++i) { scanf("%d", &a[i]); sum += a[i]; } sum /= n; int ans = 0; for (int i = 0; i < n; ++i) { ans += abs(a[i] - sum); } printf("Set #%d\nThe minimum number of moves is %d.\n\n", ++t, ans >> 1); } return0; }