Help! Java NZEC error

This code runs fine on my BlueJ compiler but gives Nzec error on the codechef complier…can someone check this please!?
Question link: Contest Page | CodeChef

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--;
                    }
                }
            }

Please either format your code or (better!) link to your submission - the forum software has mangled it and it won’t compile! :slight_smile:

Also - what Problem are you trying to solve?

Contest Page | CodeChef this is the question

Solution: 43342667 | CodeChef the submission link

1 Like