In reference to question - http://www.codechef.com/problems/ALEXNUMB/

I am not able to understand why I am getting the wrong output error. Any help will be appreciated.

#include<stdio.h>
#include<stdlib.h>
void method()
{
int t,i,n;
long long int b;
scanf("%d",&t);
while(t–)
{
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%lli",&b);
long int a = (n*(n-1))/2;
printf("%li\n",a);
}
}

int main()
{
method();
return 0;
}

You need to define (declare,assign and read) both variables n and a as long long int to avoid integer overflow.

Check your same code accepted with this modifications here.

P.S.: Always format your code correctly or provide link when asking for help.

Please post your code as an actual code, its hard to understand what you have posted.

Thank You.
I will keep it in mind next time to post the code correctly.