qyliang/CodeNanoFix huggingface dataset:
Buggy code:
n, m = map(int, input().split())
a = [int(i) for i in input().split()]
x = n - sum(a)
print(x) if x else print(-1)

Fixed code:
n, m = map(int, input().split())
a = [int(i) for i in input().split()]
x = n - sum(a)
print(x) if x>=0 else print(-1)
Buggy code:
import numpy as np

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

suma=np.sum(A)
remain=N-suma
       
if remain>=0:
       print(remain)
else:
       print('-1')


Fixed code:
import numpy as np

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

suma=np.sum(A)
remain=N-suma

if remain>=0:
	print(remain)
else:
	print(-1)
Buggy code:
ip1 = input()
ip1list = ip1.split(" ")
N = int(ip1list[0])
M = int(ip1list[1])
ip2 = input()
A_sub = ip2.split(" ")
A = []
for a in A_sub:A.append(int(a))

for a in A:
    N -= a
if N<=0:
    print(-1)
else:
    print(N)

Fixed code:
ip1 = input()
ip1list = ip1.split(" ")
N = int(ip1list[0])
M = int(ip1list[1])
ip2 = input()
A_sub = ip2.split(" ")
A = []
for a in A_sub:A.append(int(a))
r = N-sum(A)
if r < 0:
    print(-1)
else:
    print(r)
Buggy code:
n,m = map(int,input().split())
a = list(map(int,input().split()))

print(n-sum(a) if n>sum(a) else -1)

Fixed code:
n,m = map(int,input().split())
a = list(map(int,input().split()))

print(n-sum(a) if n>=sum(a) else -1)
Buggy code:
N = int(input())
M = int(input())
A = list(map(int(input().split)))
a = sum(A)
if N - a >= 0:
    print(N-a)
else:
    print(-1)
    
        


Fixed code:
N,M = map(int, input().split())
A = list(map(int, input().split()))
a = sum(A)
ans = N -a
if ans >= 0:
    print(ans)
else:
    print(-1)
Buggy code:
N,M = map(int, input().split())
A = [list(map(int,input().split()))]
print(A)
SUM = sum(A[0])
if SUM>N:
    print(-1)
else:
    print(N-SUM)

Fixed code:
N,M = map(int, input().split())
A = [list(map(int,input().split()))]
SUM = sum(A[0])
if SUM>N:
    print(-1)
else:
    print(N-SUM)
Buggy code:
N,M = map(int,input().split())
A = list(map(int,input().split()))
if sum(A) > N:
  print("-1")
else:
  print(M - sum(A))

Fixed code:
N,M = map(int,input().split())
A = list(map(int,input().split()))

if sum(A) > N:
    print(-1)
else:
    print(N-sum(A))
Buggy code:
n, m = map(int, input().split())
As = list(map(int, input().split()))

vacation = n-sum(As)
if vacation < 0:
	print('-1')
else:
	print vacation

Fixed code:
n, m = map(int, input().split())
As = list(map(int, input().split()))

vacation = n-sum(As)
if vacation < 0:
	print('-1')
else:
	print(vacation)
Buggy code:


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

s = sum(li)
if (s < n):
    print(n - s)
else:
    print(-1)


Fixed code:


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

s = sum(li)
if (s > n):
    print(-1)
else:
    print(n - s)
Buggy code:
n, m =map(int, input().split())
a =list(map(int, input().split()))

if n-sum(a) >0:
  print(n-sum(a))

else: print("-1")

Fixed code:
n,m = map(int,input().split())
a = list(map(int,input().split()))
if n-sum(a) >= 0:
  print(n-sum(a))
else:
  print(-1)
Buggy code:
#b
n,m=[int(i)for i in input().split()]
arr=[]
for i in range(m):
  x=int(input())
  arr.append(x)
s=sum(arr)
if s>n:
  print(-1)
elif s==n:
  print(0)
else:
  print(n-s)



Fixed code:
#b
n,m=[int(i)for i in input().split()]

arr=[int(i)for i in input().split()]
s=sum(arr)
if s>n:
  print(-1)
elif s==n:
  print(0)
else:
  print(n-s)
Buggy code:
n,m= map(int,input().split())
a=list(map(int, intput().split()))
sum=0
for _ in range(len(a)):
  sum+=a[i]
if sum>n: 
  print("-1")
else:
  print(n-sum)
	

Fixed code:
n,m= map(int,input().split())
a=list(map(int, input().split()))
sum=0
for i in range(len(a)):
  sum+=a[i]
if sum>n: 
  print("-1")
else:
  print(n-sum)
Buggy code:
def main():
 n, m = map(int,input().split())
 a = list(map(int,input().split()))
 sum = sum(a)
 if sum <= n:
  print(n - sum)
 else:
  print(-1)
      
main()


Fixed code:
def main():
 n, m = map(int,input().split())
 a = list(map(int,input().split()))
 Sum = sum(a)
 if Sum <= n:
  print(n - Sum)
 else:
  print(-1)
      
main()
Buggy code:
n,m=map(int,input())
a=list(map(int,input().split()))
b=sum(a)
print(max(-1,n-b))

Fixed code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
b=sum(a)
print(max(-1,n-b))
Buggy code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
if sum(a)-n>=0:
  print((sum(a)-n))
else:
  print(-1)
  

Fixed code:
n,m = map(int,input().split())
a = list(map(int,input().split()))

s = sum(a)
if s > n:
    print(-1)
else:
    print(n-s)
Buggy code:
N, M = map(int, input().split())
A = list(map(int, input().split())) 
homework = sum(A)
playday = N - homework
if playday > 0:
  print(playday)
else:
  print(-1)

Fixed code:
N, M = map(int, input().split())
A = list(map(int, input().split())) 
homework = sum(A)
playday = N - homework
if playday >= 0:
  print(playday)
else:
  print(-1)
Buggy code:
n,m=map(int,input().split())
l=list(map(int,input().split()))
ans=n
for i in l:
  ans-=i
  if ans<=0:
    ans=-1
    break
print(ans)

Fixed code:
n,m=map(int,input().split())
l=list(map(int,input().split()))
ans=n
for i in l:
  ans-=i
  if ans<0:
    ans=-1
    break
print(ans)
Buggy code:
n, m = map(int, input().split())
A = sum(list(map(int, input(.split()))))
if A <= n:
    print(n-A)
else:
    print(-1)

Fixed code:
n, m = map(int, input().split())
A = sum(list(map(int, input().split())))
if A <= n:
    print(n-A)
else:
    print(-1)
Buggy code:
a = input()
b = input()

days,home = [int(i) for i in a.split(" ")]
cost = [int(n) for n in b.split(" ")]
#print(days,home)
#print(cost)

validdate = int(days) - sum(cost)
if validdate >= 0:
    print(validdate)
else:
    print(0)

Fixed code:
a = input()
b = input()

days,home = [int(i) for i in a.split(" ")]
cost = [int(n) for n in b.split(" ")]
#print(days,home)
#print(cost)

validdate = int(days) - sum(cost)
if validdate >= 0:
    print(validdate)
else:
    print(-1)
Buggy code:
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))

if n>sum(a):
    print(n-sum(a))
else:
    print('-1')

Fixed code:
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))

if n>=sum(a):
    print(n-sum(a))
else:
    print('-1')
Buggy code:
n,m = list(map(int, input().split()))
hoge = list(map(int, input().split()))

wa = sum(hoge)
if wa >= n:
  print(-1)
else:
  print(n - wa)

Fixed code:
n,m = list(map(int, input().split()))
hoge = list(map(int, input().split()))
 
wa = sum(hoge)
if wa > n:
  print(-1)
else:
  print(n - wa)
Buggy code:
# summer vacations, number of assignments
N, M = list(map(int, input().split()))
# each entry in A represents number of days to do the assignment
A = list(map(int, input().split()))

number_of_days_required = sum(A)
maximum_hangout_days = N - number_of_days_required
if maximum_hangout_days >= 0:
  print(maximum_hangout_days)
  else:
    print(-1)

Fixed code:
# summer vacations, number of assignments
N, M = list(map(int, input().split()))
# each entry in A represents number of days to do the assignment
A = list(map(int, input().split()))

number_of_days_required = sum(A)
maximum_hangout_days = N - number_of_days_required
if maximum_hangout_days >= 0:
    print(maximum_hangout_days)
else:
    print(-1)
Buggy code:
n, m = map(int, input().split())
a = list(map(int, input().split()))

if sum(a) < n:
    print(n - sum(a))
else:
    print(-1)


Fixed code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
total = sum(a)
if total <= n:
    print(n - total)
else:
    print(-1)
Buggy code:
N,M=map(int,input().split())
lists0=list(map(int,input().split()))
lists1=lists0[0:M-1]
SUM=sum(lists1)
X=N-SUM
if X>=0:print(X)
else:print("-1")

Fixed code:
N,M=map(int,input().split())
lists0=list(map(int,input().split()))
lists1=lists0[0:M-1]
SUM=sum(lists0)
X=N-SUM
if X>=0:print(X)
else:print(-1)
Buggy code:
N,M=list(map(int, input().split()))
A=list(map(int, input().split()))
ans=sum(A)
if N<ans:
    print('-1')
else:
    print(M-ans)

Fixed code:
N,M = map(int,input().split())
A = list(map(int,input().split()))

sumA = sum(A)
if N < sumA:
    print(-1)
else:
    print(N-sum(A))
Buggy code:
N, M = int(input().split())
A = [int(a) for a input().split()]
tmp = N - sum(A)
if tmp >= 0:
    print(tmp)
else:
    print(-1)


Fixed code:
N, M = [int(x) for x in input().split()]
A = [int(a) for a in input().split()]
tmp = N - sum(A)
if tmp >= 0:
    print(tmp)
else:
    print(-1)
Buggy code:
import sys

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

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

if sum(cur) >= n:
    print(-1)
else:
    print(n - sum(cur))

Fixed code:
import sys

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

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

if sum(cur) > n:
    print(-1)
else:
    print(n - sum(cur))
Buggy code:
N,M=map(int,input().split())
A=list(map(int,input().split()))
sumA=sum(A)
if N>sum(A):
    print(N-sumA)
else:
    print('-1')

Fixed code:
N, M = map(int, input().split())
A = list(map(int, input().split()))

if sum(A) > N:
  print(-1)
else:
  print(N - sum(A))
Buggy code:
N, M = input().split()

N = int(N)
M = int(M)

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


if sum(a) < N:
    print(N-sum(a))

if sum(a) > N:
    print(-1)

Fixed code:
N, M = input().split()

N = int(N)
M = int(M)

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


if sum(a) < N:
    print(N-sum(a))

if sum(a) == N:
    print(0)

if sum(a) > N:
    print(-1)
Buggy code:
n,m=int(input.split())
s=0
for i in input.split():
  s=s+i
if s>n:
  print("-1")
else:
  print(n-s)



Fixed code:
n,m=map(int, input().split())
s=0
for i in input().split():
    s=s+int(i)
if s>n:
    print("-1")
else:
    print(n-s)
Buggy code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)


############ ---- Input Functions ---- ############
def in_int():
    return (int(input()))


def in_list():
    return (list(map(int, input().split())))


def in_str():
    s = input()
    return (list(s[:len(s) - 1]))


def in_ints():
    return (map(int, input().split()))

mod = 7 + 10**9

n, m = in_ints()

a = in_list()

if n > sum(a):
    print(n-sum(a))
else:
    print(-1)

Fixed code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)


############ ---- Input Functions ---- ############
def in_int():
    return (int(input()))


def in_list():
    return (list(map(int, input().split())))


def in_str():
    s = input()
    return (list(s[:len(s) - 1]))


def in_ints():
    return (map(int, input().split()))

mod = 7 + 10**9

n, m = in_ints()

a = in_list()

if n >= sum(a):
    print(n-sum(a))
else:
    print(-1)
Buggy code:
n, m = map(int, input().split())
a = list(map(int, input().split()))

x = n - sum(a)
print(x if x > 0 else -1)

Fixed code:
n,m = map(int,input().split())
a = sum(list(map(int,input().split())))
print(-1 if a>n else n-a)
Buggy code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
print(N - sum(A) if N - sum(A) > 0 else 0)

Fixed code:
N, M = map(int, input().split())
A = list(map(int, input().split()))

if N -sum(A) >= 0:
    print(N - sum(A))
else:
    print(-1)
Buggy code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
study_sum = sum(a)
tem_ans = n - study_sum
print(tem_ans) if tem_ans > 0 else print(-1)



Fixed code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
study_sum = sum(a)
tem_ans = n - study_sum
print(tem_ans) if tem_ans >= 0 else print(-1)
Buggy code:
n,m = map(int,input().split())
list1 = list(map(int,input().split()))
if(n>sum(list1)):
  print(n-sum(list1))
else:
  print(-1)

Fixed code:
n,m = map(int,input().split())
list1 = list(map(int,input().split()))
if(n>=sum(list1)):
  print(n-sum(list1))
else:
  print(-1)
Buggy code:
import numpy as np

N, M = input().split()

A=[int(x) for x in input().split()]

if np.sum(A) < int(N):
    print(int(N)-np.sum(A))
    
else:
    print(-1)

Fixed code:
import numpy as np

N, M = input().split()

A=[int(x) for x in input().split()]

if np.sum(A) <= int(N):
    print(int(N)-np.sum(A))
    
else:
    print(-1)
Buggy code:
n,m=map(int,input().split())
l=list(map(int,input().split()))
s=sum(l)
if s>l:
  print(-1)
else:
  print(l-s)

Fixed code:
n,m=map(int,input().split())
l=list(map(int,input().split()))
s=sum(l)
if s>n:
  print(-1)
else:
  print(n-s)
Buggy code:
N,M=map(int,input().split())
A=map(int,input().split())

if N < sum(A):
  print(-1)
else:
  print(N - sum(A))
  


Fixed code:
N,M = map(int,input().split())
A = list(map(int,input().split()))

if N < sum(A):
    print(-1)
else:
    print(N - sum(A))
Buggy code:
n , m = map(int, input().split())
a = list(map(int, input().split()))
print(max(n - sum(a)), -1)

Fixed code:
n, m = map(int, input().split())
a = list(map(int, input().split()))

print(max(n - sum(a), - 1))
Buggy code:
from operator import add
import functools


n = int(input())
m = int(input())
list_homework = input().split(" ")
list_homework = [int(list_homework[i]) for i in range(len(list_homework))]  

rest_day = n - functools.reduce(add, list_homework)

if rest_day >= 0:
    print(rest_day)
else:
    print("-1")

Fixed code:
from operator import add
import functools


n = input().split(" ")

list_homework = input().split(" ")
list_homework = [int(list_homework[i]) for i in range(len(list_homework))]  

rest_day = int(n[0]) - functools.reduce(add, list_homework)

if rest_day >= 0:
    print(rest_day)
else:
    print("-1")
Buggy code:
t=list(map(int,input().split()))		
s=list(map(int,input().split()))		

temp = 0
for i in s:
  temp += i
  
if(s[0]-temp>=0):
  print(s[0]-temp)
else:
  print(-1)
  
  

Fixed code:
t=list(map(int,input().split()))		
s=list(map(int,input().split()))		
 
temp = 0
for i in s:
  temp += i

# print(temp)
if(t[0]-temp>=0):
  print(t[0]-temp)
else:
  print(-1)
Buggy code:
N, M = map(int, input().split())
A = list(map(int,input(),split()))
a = sum(A)

if N >= a:
  print(int(N-a))
if N < a:
  print(-1)

Fixed code:
N, M = map(int, input().split())
A = list(map(int,input().split()))
a = sum(A)
 
if N >= a:
  print(int(N-a))
else:
  print(-1)
Buggy code:
N, M = map(int, input().split())
A = input().split()
travail = 0
for i in range(0, len(A)):
    A[i] = int(A[i])
    travail += A[i]

if N - travail > 0:
    print(N - travail)
else:
    print(-1)


Fixed code:
N, M = map(int, input().split())
A = input().split()
travail = 0
for i in range(0, len(A)):
    A[i] = int(A[i])
    travail += A[i]

if N - travail >= 0:
    print(N - travail)
else:
    print(-1)
Buggy code:
n,m = map(int,input().split())
A = list(int(input()).split())
tmp = n-sum(A)

if tmp >= 0:
  print(tmp)
else:
  print(-1)
  

Fixed code:
n,m = map(int,input().split())
A = list(map(int,input().split()))
tmp = n-sum(A)

if tmp >= 0:
  print(tmp)
else:
  print(-1)
Buggy code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
print(N-sum(A) if N-sum(A)>0 else -1)

Fixed code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
if sum(A)>N:
  print(-1)
else:
  print(N-sum(A))
Buggy code:
N,M = map(int, input().split())

a = [int(input()) for i in range(M)]

if(N >= sum(a)):
    print(N - sum(a))
else:
    print(-1)

Fixed code:
N,M = map(int, input().split())

a = [int(M) for M in input().split()]

if(N >= sum(a)):
    print(N - sum(a))
else:
    print(-1)
Buggy code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
flag = True

for i in  A:
N = N - i
if N < 0:
flag = False
break

if flag == True:
print(N)
else:
print(-1)

Fixed code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
flag = True
 
for i in  A:
  N = N - i
  if N < 0:
    flag = False
    break
 
if flag == True:
  print(N)
else:
  print(-1)
Buggy code:
a = list(map(int, input().split()))
b = list(map(int, input().split()))
if a[0] == sum(b):
  print(-1)
else:
  print(a[0] - sum(b))

Fixed code:
a = list(map(int, input().split()))
b = list(map(int, input().split()))
if a[0] < sum(b):
  print(-1)
else:
  print(a[0] - sum(b))
Buggy code:
N, M = input().split()
A = input().split()

N = int(N)
M = int(M)
#print(N,M,A)

sum = 0
for i in A:
    sum += int(i)

#print(sum)

ans = N - sum
if(ans > = 0):
    print(ans)
else:
    print(-1)

Fixed code:
N, M = input().split()
A = input().split()

N = int(N)
M = int(M)
#print(N,M,A)

sum = 0
for i in A:
    sum += int(i)

#print(sum)

ans = N - sum
if(ans >= 0):
    print(ans)
else:
    print(-1)
Buggy code:
def main():
    n,m=map(int,input().split())
    a=list(map(int,input().split()))
    s=sum(a)
    ans=n-s if n-s>0 else -1
    print(ans)

if __name__ == '__main__':
    main()

Fixed code:
def main():
    n,m=map(int,input().split())
    a=list(map(int,input().split()))
    s=sum(a)
    ans=n-s if n-s>=0 else -1
    print(ans)

if __name__ == '__main__':
    main()
Buggy code:
n,m = map(int,input().split())
a = list(map(int,input().split()))

if n-sum(a) < 0:
    print(0)
else:
    print(n-sum(a))

Fixed code:
n,m = map(int,input().split())
a = list(map(int,input().split()))

if n-sum(a) < 0:
    print(-1)
else:
    print(n-sum(a))
Buggy code:
N,M = map(int,input().split())

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

a = sum(l)

if N-a > 0:
    print(N-a)

else:
    print(-1)

Fixed code:
N,M = map(int,input().split())

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

a = sum(l)

if N-a >= 0:
    print(N-a)

else:
    print(-1)
Buggy code:
n,m = map(int,input().split())
a = list(map(int,input().split()))

if N-sum(a) >= 0:
	print(N-sum(a))
else:
	print('-1')

Fixed code:
n,m = map(int,input().split())
a = list(map(int,input().split()))
 
if n-sum(a) >= 0:
	print(n-sum(a))
else:
	print('-1')
Buggy code:
N, M = map(int, input().split())
A = list(map(int, input(),split()))
sum = sum(A)
if sum > N:
    ans = -1
else:
    ans = N - sum
print(ans)


Fixed code:
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))

a = N - sum(A)
if a >= 0:
    ans = a
else:
    ans = -1
print(ans)
Buggy code:
n,m = map(int, input().strip().sprit(' '))

homework = list(map(int, input().strip().sprit(' ')))

day = n - sum(homework)

if day >= 0:
  print(day)
else:
  print(-1)

  

Fixed code:
n,m = map(int, input().strip().split(" "))
 
homework = list(map(int, input().strip().split(" ")))
 
day = n - sum(homework)
 
if day >= 0:
    print(day)
else:
    print(-1)
Buggy code:
n,m=map(int(input().split()))
print(max(-1,n-sum(list(map(int,input().split())))))

Fixed code:
n,m=map(int,input().split())
print(max(-1,n-sum(list(map(int,input().split())))))
Buggy code:
n,m = (int(x) for x in input().split())
a = (int(x) for x in input().split())
for node in a:
	n = n - node
print(n if n > 0 else -1)

Fixed code:
n,m = (int(x) for x in input().split())
a = (int(x) for x in input().split())
for node in a:
	n = n - node
print(n if n >= 0 else -1)
Buggy code:
n,m=map(int,input().split())
list1=list(map(int,input().split()))
ans=n-sum(list1)
print(ans if ans>=0 else 0)
  

Fixed code:
n,m=map(int,input().split())
list1=list(map(int,input().split()))
ans=n-sum(list1)
print(ans if ans>=0 else -1)
Buggy code:
N, M = map(int, input().split())
day_cost = [int(i) for i in input().split()]
holidays = N-sum(day_cost)

if holidays > 0:
    print(holidays)
else:
    print-1

Fixed code:
N, M = map(int, input().split())
day_cost = [int(i) for i in input().split()]
holidays = N-sum(day_cost)

if holidays >= 0:
    print(holidays)
else:
    print(-1)
Buggy code:
N, M
A = sum([int(x) for x in input().split()])
if N - M < 0:
  print(-1)
else:
  print(N-M)

Fixed code:
N, M = map(int, input().split())
A = sum([int(x) for x in input().split()])
if N - A < 0:
  print(-1)
else:
  print(N-A)
Buggy code:
n,m=(int(i) for i in input().split())
a=[int(i) for i in input().split()]
s=sum(a)
if n-a>=0:
  print(n-a)
else:
  print(-1)

Fixed code:
n,m=(int(i) for i in input().split())
a=[int(i) for i in input().split()]
s=sum(a)
if n-s>=0:
  print(n-s)
else:
  print(-1)
Buggy code:
n,m=map(int, input().split(' '))
a = list(map(int, input().split()))
res = n-sum(a)
print(res if res >= 0 else -1

Fixed code:
n,m = map(int,input().split())
a = list(map(int,input().split()))

print(n-sum(a) if n-sum(a) >= 0 else -1)
Buggy code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
if sum(a) >= n:
  print(-1)
else:
  print(n - sum(a))

Fixed code:
n,m = map(int,input().split())
lis = list(map(int,input().split()))
if sum(lis) > n:
    print(-1)
else:
    print(n-sum(lis))
Buggy code:
N,M = map(int,input().split())
A_lis = map(int,input().split())

can_play = N - sum(A_lis)
print(can_play if can_play > 0 else -1)

Fixed code:
N,M = map(int,input().split())
A_lis = map(int,input().split())

can_play = N - sum(A_lis)
print(can_play if can_play >= 0 else -1)
Buggy code:
vacationDayCount, homeworkCount = map(int, input().split())
requiredDayList = list(map(int, input.split()))

playableDayCount = vacationDayCount - sum(requiredDayList)

if(playableDayCount >= 0):
    print(playableDayCount)
else:
    print(-1)

Fixed code:
vacationDayCount, homeworkCount = map(int, input().split())
requiredDayList = list(map(int, input().split()))

playableDayCount = vacationDayCount - sum(requiredDayList)

if(playableDayCount >= 0):
    print(playableDayCount)
else:
    print(-1)
Buggy code:
n,m= list(map(int,input().split(" ")))
arr = list(map(int,input().split(" ")))
print(sum(arr))
if(sum(arr)>n):
    print(-1)
elif(sum(arr)==n):
    print(0)
else:
    print(n-sum(arr))

Fixed code:
n,m= list(map(int,input().split(" ")))
arr = list(map(int,input().split(" ")))
if(sum(arr)>n):
    print(-1)
elif(sum(arr)==n):
    print(0)
else:
    print(n-sum(arr))
Buggy code:
import sys
import math
input = sys.stdin.readline
n, m = map(int, input().split())
A = [int(i) for i in input().split()]
del A[m:len(A)]
print(n - sum(A)) if sum(A) < n else print(-1)


Fixed code:
import sys
input = sys.stdin.readline
n, m = map(int, input().split())
A = [int(i) for i in input().split()]
del A[m:len(A)]
print(n - sum(A)) if sum(A) <= n else print(-1)
Buggy code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
ans = n
for i in a:
  ans -= i
  if ans < 0:
    print(-1)

print(ans)

Fixed code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
ans = n
for i in a:
  ans -= i

if ans < 0:
  print(-1)
else:
  print(ans)
Buggy code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
b = sum(a)
print(n-b if n>b else -1)

Fixed code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
b = sum(a)
print(n-b if n>=b else -1)
Buggy code:
n,m = map(int, input().split())

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

print(n-sum(a) if n-sum(a) > 0 else "-1")

Fixed code:
n,m = map(int,input().split())
a = list(map(int,input().split()))
hang_day = n - sum(a)
if hang_day >= 0 :
    print(hang_day)
else:
    print('-1')
Buggy code:
days,num = map(int,input().split())
homeworks = list(map(int,input().split()))

temp = sum(homeworks)

if temp > days:
    print(-1)
else:
    print(days-days)


Fixed code:
days,num = map(int,input().split())
homeworks = list(map(int,input().split()))

temp = sum(homeworks)

if temp > days:
    print(-1)
else:
    print(days-temp)
Buggy code:
N,M = int(input().split())
A = list(map(int, input().split()))

if N-sum(A) < 0:
    print("-1")
else:
    print(N-sum(A))


Fixed code:
N , M = map(int,input().split())
A = list(map(int,input().split()))
if N < sum(A):
    print(-1)
else:
    print(N - sum(A))
Buggy code:
N,M=map(int,input().split())
A=map(int,input().split())
if N>sum(A):
    print(N-sum(A))
else:
    print(-1)

Fixed code:
N,M = map(int,input().split())
A = list(map(int,input().split()))
print(N-sum(A) if N>=sum(A) else -1)
Buggy code:
n,m = map(int(input().split()))
a = list(map(int,input().split()))
sum = sum(a)
if n-sum >= 0:
	print(n-sum)
else:
	print(-1)

Fixed code:
n, m = map(int, input().split())
a = sum(list(map(int, input().split())))

if a > n:
    print(-1)
else :
    print(n - a)
Buggy code:
import numpy as np
N, M = map(int, input().split())
A_list = np.array(list(map(int, input().split())))

total = np.sum(A_list)
free_day = max(N - M, -1)
print(free_day)

Fixed code:
import numpy as np
N, M = map(int, input().split())
A_list = np.array(list(map(int, input().split())))

total = np.sum(A_list)
free_day = max(N - total, -1)
print(free_day)