GETTING DIFFERENTOUTPUT TO SAME INPUT ON CODECHEF

I am getting different output to same input on CODE CHEF IDE and I am getting answer on my local IDE. the question link is CodeChef.

My code is

#include <stdio.h>

int main(void)
{
int a[1000],n,t,j;
// printf(“Enter test cases\n”);
scanf("%d",&t);
while(t–)
{
// printf(“Enter size of array: “);
scanf(”%d”,&n);
if (n%2!=0)
{
printf("-1\n");
}
else
{
// printf(“enter array value\n”);
int sum=0;
for(j=1;j<=n;j++)
{
scanf("%d",&a[j]);
sum=sum+a[j];
}
// printf(“Sum is %d\n”,sum);
if(sum==0)
{
printf(“0\n”);
}
else
{
printf("%d\n",(sum/2));
}
}

}

return 0;

}

Please help what could be the problem

@arish1104 - what was the input that you were providing?