Runtime error (NZEC) in Python

This gives me a runtime error in codechef. However it works just fine when I use it in enthought canopy. Please help

t = int(raw_input())
i = 0
while (i < t):
i = i + 1
m = int(raw_input())
s = input()
x = int(s)%m
print(x)