Because "40 30" is not an integer, so if you input it to start with you will get an error saying that:
for _ in range(int(input())):
If you enter it at your second input, then the split generates a list which isn't convertible directly to an integer either.
Try this:
import math
for _ in range(int(input())):
l , b = input().split()
print(math.gcd(int(l),int(b)))