Please help me in finding nzec error in java code(Problem Crash It(CRSHIT) )

/* package codechef; // don't place package name! */

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

/* Name of the class has to be “Main” only if the class is public. */
class Codechef
{
public static void main(String[] args) {
Scanner scan=new Scanner(System.in);
long n=scan.nextLong();
long q=scan.nextLong();
long k1=scan.nextLong();
double k=k1;
List list1=new ArrayList();
List list2=new ArrayList();
for(int i=0;i<n;i++){
int a=scan.nextInt();
if(a==1)
list1.add(scan.nextInt());
else
list2.add(scan.nextInt());
}
int qarr[]=new int[(int) q];
for(int i=0;i<q;i++)
qarr[i]=scan.nextInt();
long dis1[][]=new long[list1.size()][list2.size()];
for(int i=0;i<list1.size();i++){
int a=list1.get(i);
for(int j=0;j<list2.size();j++){
int b=list2.get(j);
if(a<=b){
dis1[i][j]=b-a;
}
else{
dis1[i][j]=(long) ((k)-a+b);
}

	}
	Arrays.sort(dis1[i]);
}

int m=0;
double k2=k/2; ;
while(q>0){
long ans=0;
long t=qarr[m];
for(int i=0;i<list1.size();i++){
double x=t/k2;
ans+=(long)xlist2.size();
double y=t%k2;
if(y>0){
y=y
2;
int a=Arrays.binarySearch(dis1[i],(long) y);
if(a<0)
a=(a*-1)-1;
else a=a+1;
ans+=a;
}
}
System.out.println(ans);
–q;
++m;
}
scan.close();
}

}

Please either format your code or 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?

Thanks for replying sir.
[this is my solution ](https://www.codechef.com/viewsolution/28479378)
[problem link CRSHIT](https://www.codechef.com/problems/CRSHIT).
Code is working fine on Eclipse.But giving nzec on codechef ide
1 Like