I am getting wrong answer for Chef Wars - Return of the Jedi

I think I have done the right thing but it shows Wrong Answer, please help
This is my code
testcases = int(input())
for i in range(testcases):
a = input()
health , damage = a.split(" ")
health , damage = int(health),int(damage)
if damage%2 != 0:
print(0)
else:
while damage>1 and not health<0:
health-=damage
damage = damage//2
if health>0:
print(0)
else:
print(1)