NOJ/99/main.c

22 lines
318 B
C
Raw Permalink Normal View History

2020-08-31 16:46:43 +00:00
#include <stdio.h>
int a[1000005], c[1000005];
int main(void){
int n;
while(scanf("%d",&n) != EOF){
long long sum = 0;
for(int i = 0; i < n; i++){
scanf("%d",a+i);
sum += a[i];
}
long long avg = sum / n;
c[0] = 0;
for(int i = 1; i < n; i++){
c[i] = c[i-1] - a[i] + avg;
}
}
return 0;
}