getting runtime error NZEC in java but running all cases on eclipse

import java.util.*;

public class testcase{
public static void main(String args[]) throws Exception {
Scanner s = new Scanner(System.in);
int t=s.nextInt();
while(t>0)
{
int n;
n=s.nextInt();
int a=s.nextInt();
int b=s.nextInt();
int m[]=new int[500000];
int index=0;
for(int i=0;i<=n;i++)
{
for(int j=0;j<=(n-i);j++)
{
m[i*(n)+j+count]=(aj)-(b(n-i-j));

     }
     index=1;
     
 }
 int total=0;
 int g,k;
 for( k=0;k<(n*n+2);k++)
 {
     for(g=0;g<k;g++)
        if(m[k]==m[g])
        break;
     if(g==k)
     total++;
 }
 System.out.println(total);
 t--;
 }

}
}

//