Cleaning Up runtime error

Hi,
I was trying out Clean Up problem from Practice section, but this code I wrote is giving me an NZEC. I have no idea why.

Code:

from __future__ import division
def read_mapped(func=lambda x:x):
    return map(func, raw_input().strip().split(" "))
def read_int():
    return int(raw_input().strip())
def read_str():
    return raw_input().strip()
def read_float():
    return float(raw_input().strip())

T = read_int()

for case in xrange(T):
    n, m = read_mapped(int)
    lis = range(1, n+1)
    jobs = read_mapped(int) if m!=0 else []

    for j in jobs:
        lis.remove(j)

    chef = []
    assistant = []
    for i, index in enumerate(lis):
        if i%2==0:
            assistant.append(str(index))
        else:
            chef.append(str(index))

    print "" if not assistant else " ".join(assistant)
    print "" if not chef else " ".join(chef)

I’ve tried all test cases I could imagine, it works fine. Please tell me why this is giving me an NZEC.

Thanks.

Try out this code in python 3.4 for CLEANUP problem

t=int(input());

for t in range(t):

m=[int(i) for i in input().split()];
n=[int(i) for i in input().split()];

li=list(range(1,m[0]+1));

for i in n:
    if i in li:
        li.remove(i);

C=[];
S=[];

for i in range(len(li)):
    if i%2==0:
        C.append(str(li[i]));
    else:
        S.append(str(li[i]));
        
print (' '.join(C));
print (' '.join(S));

admin help