NZEC in Problem Code: TEAMMATE

Problem Code: TEAMMATE
,Why am I getting NZEC in Finding Teammate?

Link to my solution in Python 3

also, can anyone please provide a test case for which above code fails, after NZEC is removed?

Generator for NZEC case

print(1)
print(100000)
print(*[1]*100000)

I’ll reiterate what I wrote in a comment elsewhere:

All the lines with factorials are sketchy. The main problem is that you’re using floating point division / rather than integer division // in a lot of places, including the division of the factorials.

But even if that is fixed your solution should get TLE, but at least it would no longer be NZEC. To avoid TLE you need to avoid computing with too large numbers, make use of the mod when calculating stuff!