N,M = list(map(int, input().split()))

A = list(map(int, input().split()))



ans = max(N - sum(A), -1)

print(ans)
N,M = list(map(int, input().split()))

A = list(map(int, input().split()))



print((max(-1, N - sum(A))))
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
ans = max(N - sum(A), -1)
print(ans)

N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
print((max(-1, N - sum(A))))

-ans = max(N - sum(A), -1) -print(ans) +print((max(-1, N - sum(A))))