#pragma TASS input 
int N_BOUND;
#pragma TASS input {N>0 && N<=N_BOUND} 
int N;
#pragma TASS input 
double a[N];
#pragma TASS output 
double s;

void main() {
	int i=1;
	double x=0.0;
	
l1:
#pragma TASS jointinvariant @main{x*(i-1) == spec.x && i-1 == spec.i && i > 0 && spec.i <= N}
	while (i < N + 1) {
		x = ((i-1)*x + a[i-1])/i;
		i = i + 1;
	}
	s = x;
}
