How to find NZEC error ??

I am facing NZEC runtime error in this code… what wrong am i doing??

t=int(raw_input())
while(t>0):
c=int(input())
d=int(input())
l=int(input())
if l%4==0:
l1=l/4
if l1<= c+d:
if c<=2d and l1>=d:
print “yes\n”
elif c>2
d and l1>= c+d-2*d:
print “yes\n”
else:
print “no\n”
else:
print “no\n”
else:
print “no\n”
t-=1

@adicodechef

I highly suspect that the error is due to missing return statement and “main()”

Change it to “int main()” and add a “return 0;” in end of program.

Plz Help me I Am Getting Same Error

Code Here-

/* 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) throws java.lang.Exception
{
BufferedReader p = new BufferedReader(new InputStreamReader(System.in));

	int queries= Integer.parseInt(p.readLine());
	int big,small;
	for (int i =0;i<=queries;i++)
	{
	    
	    int a= Integer.parseInt(p.readLine());
	     int b= Integer.parseInt(p.readLine());
	     if(a>b)
	     {
	   big=a;
	     small=b;
	  }
	  else
	  {
	    big=b;
	     small=a;  
	  }
	  
	     
	     if(a%2!=0 && b%2!=0)
	     {
	         if(a+2==b || a-2==b)
	         System.out.println("Yes");
	     }
	     else if (a%2==0 && b%2==0)
	     {
	         if(a+2==b || a-2==b)
	         System.out.println("Yes");
	     }
	     
	     else if (big-small==1 && big%2==0)
	     System.out.println("Yes");
	     
	     else
	     System.out.println("No");
	    
	    
	    
	}

}
}

def home():

x=[]

for number in range(0,4):

value = int(input('Enter the values for %dth element'%number))
x.append(value)

if x[2] - x[0] > 0 and x[1] - x[3] == 0:

print (‘right’)

elif x[0] - x[2] > 0 and x[1] - x[3] == 0:

print(‘left’)

elif x[0]-x[2] == 0 and x[1] - x[3] > 0 :

print ('down')

elif x[0] - x[2] == 0 and x[1] - x[3] > 0 :

print ('up')

else :
print (‘sad’)

test_case= int(input(‘Enter the number of test cases’))
for no in range(0,test_case):
home()

I’m getting NZEC for this code. Someone help me out!

How remove NZEC
/* 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) throws java.lang.Exception
{
Scanner sc=new Scanner(System.in);
int x=sc.nextInt();
int y=sc.nextInt();
if (y>x)
{
double b=(y-x)-0.50;
System.out.println(b);

    }
    else System.out.println(y);
    
    
    sc.close();  
}

}

why does the following code give NZEC error ?
T = input()
N = [0 for i in range (0,T)]
P = [0 for i in range(T)]
res = [“no” for i in range(T)]
p = [0 for i in range(500)]
cc = [0 for i in range(500)]
ch = [0 for i in range(500)]
for i in range(0,T):
N[i] = input()
P[i] = input()
for j in range (0, N[i]):
p[j] = input()
if (p[j]>=(P[i]/2)):
cc[i] = cc[i]+1
elif (p[j]<=(P[i]/10)):
ch[i] = ch[i]+1
if((cc[i] == 1) and (ch[i] == 2)):
res[i] = “yes”
for i in range(0,T):
print res[i]

[Solution][1]
-> Why does this code gives NZEC??

Thank You
[1]: https://www.codechef.com/viewsolution/17499462

Due to brute force consuming lot of memory in recursion calls and overflowing the memory stack. Use map data structure and memoization.

Thank you so much, i tried the memoization and got an AC.

adding an exception handler which does nothing removes the nzec error

java example:

try
{
} catch (Exception e){}