import java.util.Scanner;
import java.lang.*;
public class Main
public static void main(String[] args)

        Scanner sc = new Scanner(;
        int testcase = sc.nextInt();
    for(int i=0;i<testcase;i++)
        int a = sc.nextInt();
        int b= sc.nextInt();

   static void add(int a,int b)
        int sum=0;


This is my code.It’s a simple addition code but I’m still getting an error.The code works perfectly fine on my Intellij but here the NZEC error occurs.
Exception in thread “main” java.util.NoSuchElementException
at java.util.Scanner.throwFor(
at java.util.Scanner.nextInt(
at java.util.Scanner.nextInt(
at Main.main(

Please do help if you know how to remove this error

Did you put something in the Custom Input box or not while testing? I see that you are new to codechef and there is a tickbox for providing custom input which you must check and then put a sample input for your program. For example:

1 2
100 200
10 40

The above should yield a printed output of this:


Once your code gets this, you may click the submit button to check if your response is correct…

It worked.Thanks.
I’m actually used to codeforces so there if you press submit it works but here it seems that we have to check it before submitting.

Okay cool, no problem!