I am getting nezec error how can i overcome it

import java.util.;
import java.lang.
;
import java.io.*;

/* Name of the class has to be “Main” only if the class is public. */
class Codechef
{
// your code goes here
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc = new Scanner(System.in);
int n=sc.nextInt();
for(int i=0;i<n;i++)
{

	    long sum=0;
	    long sum1=0;
	    long count=0;
	    int m=sc.nextInt();
	    long arr[]=new long[m];
	    for(int j=0;j<m;j++)
	    {
	        arr[j]=sc.nextInt();
	    }
	    Arrays.sort(arr,0,m);
	    sum=sum+arr[0];
	    for(int l=n-1;l>=0;l--)
	    {
	       
	            arr[l]=arr[l]-count;
	            if(arr[l]<0)
	            { 
	            arr[l]=0;
	            }
	            sum=sum+arr[l];
	            count++;
	             
	    }
        sum1=sum%1000000007;
	    System.out.println(sum1);
	    
	}
}

}

it is running in my terminal perfectly