Buggy python submission (verdict: Runtime Error):
M,N = map(int,input().split())
user = list(eval(input().replace(" ",",")))
sum = 0
for i in user:
    sum = sum + int(i)
result = M - int(sum)
if result < 0:
    print("-1")
else:
    print(int(result))

Fixed submission:
N,M = (input()).split()
task = input().split()
list1 = []
sum = 0
for i in task:
    list1.append(i)
for j in list1:
    sum = sum + int(j)
result = int(N) - sum
if result < 0:
    print(-1)
else:
    print(result)

Buggy python submission (verdict: Runtime Error):
M,N = map(eval,input().split())
user = list(eval(input().replace(" ",",")))
sum = 0
for i in user:
    sum = sum + int(i)
result = M - sum
if result < 0:
    print("-1")
else:
    print(int(result))

Fixed submission:
N,M = (input()).split()
task = input().split()
list1 = []
sum = 0
for i in task:
    list1.append(i)
for j in list1:
    sum = sum + int(j)
result = int(N) - sum
if result < 0:
    print(-1)
else:
    print(result)

Buggy python submission (verdict: Runtime Error):
M,N = map(eval,input().split())
user = list(eval(input().replace(" ",",")))
sum = 0
for i in user:
    sum = sum + int(i)
result = M - sum
if result < 0:
    print("-1")
else:
    print(result)

Fixed submission:
N,M = (input()).split()
task = input().split()
list1 = []
sum = 0
for i in task:
    list1.append(i)
for j in list1:
    sum = sum + int(j)
result = int(N) - sum
if result < 0:
    print(-1)
else:
    print(result)

Buggy python submission (verdict: Runtime Error):
M,N = map(eval,input().split())
user = list(eval(input().replace(" ",",")))
sum = 0
for i in user:
    sum = sum + i
result = M - sum
if result < 0:
    print("-1")
else:
    print(result)

Fixed submission:
N,M = (input()).split()
task = input().split()
list1 = []
sum = 0
for i in task:
    list1.append(i)
for j in list1:
    sum = sum + int(j)
result = int(N) - sum
if result < 0:
    print(-1)
else:
    print(result)

Buggy python submission (verdict: Runtime Error):
M,N = map(eval,input().split())
user = list(eval(input().replace(" ",",")))
sum = 0
for i in user:
    sum = sum + i
result = M - sum
if result < 0:
    print(-1)
else:
    print(result)

Fixed submission:
N,M = (input()).split()
task = input().split()
list1 = []
sum = 0
for i in task:
    list1.append(i)
for j in list1:
    sum = sum + int(j)
result = int(N) - sum
if result < 0:
    print(-1)
else:
    print(result)

Buggy python submission (verdict: Runtime Error):
N = eval(input())
M = eval(input())
user = list(eval(input().replace(" ",",")))
sum = 0
for i in user:
    sum = sum + i
result = N - sum
if result < 0:
    print(-1)
else:
    print(result)

Fixed submission:
N,M = (input()).split()
task = input().split()
list1 = []
sum = 0
for i in task:
    list1.append(i)
for j in list1:
    sum = sum + int(j)
result = int(N) - sum
if result < 0:
    print(-1)
else:
    print(result)

Buggy python submission (verdict: Runtime Error):
user1 = eval(input().replace(" ",","))
user = list(eval(input().replace(" ",",")))
sum = 0
for i in user:
    sum = sum + i
result = list(user1)[0] - sum
if result < 0:
    print(-1)
else:
    print(result)

Fixed submission:
N,M = (input()).split()
task = input().split()
list1 = []
sum = 0
for i in task:
    list1.append(i)
for j in list1:
    sum = sum + int(j)
result = int(N) - sum
if result < 0:
    print(-1)
else:
    print(result)

Buggy python submission (verdict: Runtime Error):
user1 = eval(input().replace(" ",","))
user = list(eval(input().replace(" ",",")))
sum = 0
for i in user:
    sum = sum + i
result = list(user1)[0] - sum
if result <= 0:
    print(-1)
else:
    print(result)

Fixed submission:
N,M = (input()).split()
task = input().split()
list1 = []
sum = 0
for i in task:
    list1.append(i)
for j in list1:
    sum = sum + int(j)
result = int(N) - sum
if result < 0:
    print(-1)
else:
    print(result)

Buggy python submission (verdict: Runtime Error):
user1 = eval(input().replace(" ",","))
user = list(eval(input().replace(" ",",")))
sum = 0
for i in user:
    sum = sum + i
print(list(user1)[0] - sum)

Fixed submission:
N,M = (input()).split()
task = input().split()
list1 = []
sum = 0
for i in task:
    list1.append(i)
for j in list1:
    sum = sum + int(j)
result = int(N) - sum
if result < 0:
    print(-1)
else:
    print(result)

Buggy python submission (verdict: Runtime Error):
user1 = eval(input())
user2 = eval(input())
user = list(eval(input().replace(" ",",")))
sum = 0
for i in user:
    sum = sum + i
print(user1 - sum)

Fixed submission:
N,M = (input()).split()
task = input().split()
list1 = []
sum = 0
for i in task:
    list1.append(i)
for j in list1:
    sum = sum + int(j)
result = int(N) - sum
if result < 0:
    print(-1)
else:
    print(result)