n,m=list(map(int,input().split()))

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

print((n-sum(a) if n-sum(a)>=0 else -1))
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()))
print((n - sum(a) if n - sum(a) >= 0 else -1))

n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
print((max(-1, n - sum(a))))

-print((n - sum(a) if n - sum(a) >= 0 else -1)) +print((max(-1, n - sum(a))))