spoj.pl/problems/SOLDIERS/
i am relatively new to python. with try block it gives WA (im guessing because my code doesnt produce output for certain cases) ,with the try block it gives NZEC.
is my logic wrong? if not, how do i fix the nzec problem. thanks 
for i in range(input()):
#try:
a,b=map(int,raw_input().split(' '))
#logic removed
#except:continue