I always End up getting NZEC error (whether i use Scanner or BufferedReader , It doesn't matter)?

Here’s my code , works perfectly fine in my IDE like every other code which i write but i always always get NZEC error in at input point in code chef IDE.
I tried Scanner i got same result , i used BuffererReader i get same result . It has really become frustrating for me now as i am not able to submit most of the problems which i was solve correctly.
While when i checked solution , so many others have used int test with BufferedReader and they were able to submit the code.
I request someone to pls pls pls help me out.
Here’s my solution of code chef code -> Splitit

public class Main {
public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    final int test = Integer.parseInt(br.readLine());
    for (int i = 0; i < test; i++) {
        boolean check = false;
        int N = Integer.parseInt(br.readLine());
        String s = br.readLine();
        for(int j = 0 ; j < N-2 ; j++){
            for(int k = j+2 ; k < N ; k++){
                StringBuilder stringBuilder = new StringBuilder(s);
                String toAppend =  stringBuilder.substring(j,k);
                stringBuilder.replace(N-toAppend.length() , N , toAppend);
                if(stringBuilder.toString().equals(s)){
                    check = true;
                    break;
              }
            }
            if(check){
                break;
            }
        }

        if(check){
            System.out.println("YES");
        }else {
            System.out.println("NO");
        }
    }
}

}

change class name to Codechef and remove public keyword.

Also, learn to format code

code

Sorry for wrong formatting earlier.
And i tried what you said
but i still got

    Exception in thread "main" java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:542)
at java.lang.Integer.parseInt(Integer.java:615)
at Codechef.main(Main.java:10)

this error , 10th line is the place where int test is at for taking input.

//'main' method must be in a class 'Rextester'.
//openjdk version '11.0.5' 

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

class Codechef{
public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    final int test = Integer.parseInt(br.readLine());
    for (int i = 0; i < test; i++) {
        boolean check = false;
        int N = Integer.parseInt(br.readLine());
        String s = br.readLine();
        for(int j = 0 ; j < N-2 ; j++){
            for(int k = j+2 ; k < N ; k++){
                StringBuilder stringBuilder = new StringBuilder(s);
                String toAppend =  stringBuilder.substring(j,k);
                stringBuilder.replace(N-toAppend.length() , N , toAppend);
                if(stringBuilder.toString().equals(s)){
                    check = true;
                    break;
              }
            }
            if(check){
                break;
            }
        }

        if(check){
            System.out.println("YES");
        }else {
            System.out.println("NO");
        }
    }
}
}

This code will run, but I guess it should give TLE.

The error means that br.readLine() is giving Integer.parseInt() null string. Therefore, it cannot be converted to integer. I guess, you did not provide the correct input