My issue
T = int(input()) # Number of test cases
for _ in range(T):
A, C = map(int, input().split())
# Calculate B
B = (A + C) // 2
# Check if B is an integer and satisfies the condition
if (A + C) % 2 == 0:
print(B)
else:
print(-1)
Learning course: Logic Building in Python
Problem Link: CodeChef: Practical coding for everyone