UVa11300 - Spreading the Wealth

#include
using namespace std;
typedef long long ll;
const int maxn  = 1000000 + 10;
ll A[maxn],C[maxn],tot,M;
int main()
{
    int n;
    while(scanf("%d",&n)==1){
        tot=0;
        for(int i=1;i<=n;i++){
            scanf("%lld",&A[i]);
            tot+=A[i];
        }
        M=tot/n;
        C[0]=0;
        for(int i=1;i

你可能感兴趣的:(UVA)