// The sum of 1+(1-2)+(1-2+3)+(1-2+3-n)... where even integers are -k and odd integers are +k.
#include <stdio.h>

int ancho(int n)
{
	int sum=0;
	for(int i=1; i<=n; ++i)
	{
		for(int j=1; j<=i; ++j)
		{
			sum += (2*(j%2)-1)*j;
		}
	}
	return sum;
}

int main(void)
{
	int n = 5;
	
	printf("Solution is %d\n", ancho(n));
}

// Solution is 0 for n = 5, 
// because: 1 + (1-2) + (1-2+3) + (1-2+3-4) + (1-2+3-4+5) = 
// 1-1+2-2+3 = 