#pragma TASS input 
int N_BOUND;
#pragma TASS input {n>=0 && n<=N_BOUND}
int n;
#pragma TASS output 
int t;

void main() {
	int i = 1; 
	int j;
	int u;
	int s = 0;
	
l1:
#pragma TASS jointinvariant @main{i == spec.i && s == spec.s}
	while (i <= n) {
		u = 0;
		j = 0;
    l2:
#pragma TASS jointinvariant @main{s + i * u == spec.s && j == spec.j - 1}
		while (j < i*i) {
			u = u + j + 1;
			j = j + 1;
		}
		s = s + i * u;
		i = i + 1;
	}
	t = s;
}
