I'm trying to solve a problem on Sphere Online Judge(SPOJ) where it requires me to print all the integers between 1 and n that are divisible by x but not y, My code is right when I test on the Python IDE but when I try to input it on SPOJ, I get runtime error(NZEC), what is NZEC and why do I get it? This is my code:
test_cases = raw_input()
input = []
list = []
for z in xrange(int(test_cases)):
input = raw_input()
n,x,y = input.split(' ')
for z in xrange(int(n)):
if z%int(x) == 0 and z%int(y) != 0:
list.append(z)
answer1 = str(list).strip('[]')
answer2 = answer1.replace(',', '')
print answer2