MINFLIPS - Wrong answer

What is wrong with my code? All public test cases are passed but when i submit it, it shows wrong answer.

# cook your dish here
for _ in range(int(input())):
    n=int(input())
    l=list(map(int,input().split()))
    tot=sum(l)
    if abs(tot)%2==0:
        print(tot//2)
    else:
        print(-1)

@thelalitkr

this test case your output is -1. Expected is 1.

1
2
-1 -1