My issue
Runtime error
Traceback (most recent call last):
File “/mnt/sol.py”, line 4, in
t = int(input())
EOFError: EOF when reading a line
My code
t = int(input())
for i in range(t):
A,C = map(int,input().split())
B =int((A+C)/2)
if (A%2==0 and C%2 ==0):
print(B)
elif(A%2 != 0 and C%2 != 0):
print(B)
else:
print(-1)
# Step 1: Read and understand the problem statement and sample test cases
# Click on 'Next' once you are ready to proceed.
t = int(input())
for i in range(t):
A,C = map(int,input().split())
B =int((A+C)/2)
if (A%2==0 and C%2 ==0):
print(B)
elif(A%2 != 0 and C%2 != 0):
print(B)
else:
print(-1)
Learning course: Python for problem solving - 1
Problem Link: CodeChef: Practical coding for everyone