Unexpected NZEC error (JAVA)

A weird error is torturing me here.
It is an NZEC error.
The code runs properly in Eclipse. But Codechef’s compiler isn’t happy.

My Code:

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

/* Name of the class has to be “Main” only if the class is public. */
class chef
{
public static void main(String[] args) throws java.lang.Exception
{
// your code goes here
Scanner sc=new Scanner(System.in);
int T=sc.nextInt();
for(int i=0;i<T;i++)
{
Scanner in=new Scanner(System.in);
int flag=0;
String s=in.nextLine();
int N=s.charAt(0)-48;
int K=s.charAt(2)-48;
String st=in.nextLine();
String A[]=st.split(" ");
for(int j=0;j<(N-1);j++)
for(int k=j+1;k<N;k++)
{
int a=Integer.parseInt(A[j]);
int b=Integer.parseInt(A[j]);
if((a+b)==K)
flag=1;
}
if(flag==1)
System.out.println(“Yes”);
else
System.out.println(“No”);
}
}
}
The Error:

Are you clicking “Run” but not providing any Custom Input?

No not really.
Even if I enter a custom input I am facing this error.

Can you provide a link to the problem you’re solving and your submission?

There you go:
https://www.codechef.com/problems/CSUM

Looks like you’re tripping over some weirdness with how Java input works - looks like a call to nextLine() after a call to nextInt() doesn’t do what I’d expect. I guess it just returns the rest of the line after the int you just read?? Looking at other submissions, it looks like people just read the ints without caring which line they are on - I’d recommend doing the same :slight_smile:

Okay then. Thanks a lot