This code runs fine on my BlueJ compiler but gives Nzec error on the codechef complier…can someone check this please!?
Question link: CodeChef: Practical coding for everyone
import java.util.*;
import java.lang.*;
import java.io.*;
class CodeChef
{
public static void main (String[] args) throws java.lang.Exception, IOException
{
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
while(T>0)
{
int N= sc.nextInt();
String s= br.readLine();
int A[]= new int[N];
StringTokenizer st = new StringTokenizer(s);
for(int i=0; i<N; i++)
A[i]= Integer.parseInt(st.nextToken());
int c= 0;
for (int i=0; i<N; i++)
{
for (int j=0; j<N; j++)
{
if(i!=j)
{
int f= A[i]*A[j]+A[i]-A[j];
if(f>c)
c=f;
}
}
}
System.out.println(c);
T--;
}
}
}