Help me in solving LB01 problem

My issue

how could i check B is in integer or not

My code

# Update the program below to solve the problem

t = int(input())            
for i in range(t):          
    A, C = map(int, input().split())
    if A%2==0 and C%2==0:
        # print("both even")
        B=A+C/2
        print(B)
    
    elif A%2!=0 and C%2!=0:
        # print("both odd")
        B=A+C/2
        print(B)
        
    else:
        print("-1")
        
         
        
    
    

Learning course: Python for problem solving - 1
Problem Link: CodeChef: Practical coding for everyone

@kunal89
B will be valid when both A and C are even or both are odd .
is else case it would be -1.