TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
day = list(int(input()))
ans = list(int(input()))
num = 0
for i in range(0, len(ans)):
    num += ans[i]

target = day[0] - num

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

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

num = 0
for i in range(0, len(a)):
    num += int(a[i])

print(num)

target = n - num

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

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

num = 0
for i in range(0, len(a)):
    num += int(a[i])

target = n - num

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

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
n,m=map(int(input().split()))
a=list(map(int,input().split()))
print(max(-1,n-sum(a)))

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

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
N, M = map(int, input().split())
A_sum = 0

for i in range(M):
    A_sum += int(input())

if (N - A_sum) > 0:
    print(N - A_sum)
else:
    print("-1")

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

for i in range(M):
    sum += A[i]

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

Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
# abc163B









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


answer = n - sum(a)

if answer > 0:
    print(answer)
else:
    print("-1")


# abc163B









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



answer = n - sum(a)

if answer < 0:
    print("-1")
else:
    print(answer)


Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
def main():
    n,m = map(int,input().split())
    a = list(map(int,input().split()))
    s = sum(a)
    if s<n:
        print('-1')
    else:
        print(n-s)


if __name__ == "__main__":
    main()

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


if __name__ == "__main__":
    main()

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
N,M=map(int,input().split())
A=list(map(int,input().split()))

homework=0

for a in A:
    homework+=a

if N>hemework:
    print(N-homework)
else:
    print(-1)

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

homework=0

for a in A:
    homework+=a

if N>=homework:
    print(N-homework)
else:
    print(-1)

Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]

days = sum(A)

if days <= N:
    print(N-days)
else:
    print(-1)

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

Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
a = input().split(" ")
b = input().split(" ")
c = 0
for i in b:
    c += int(i)
if a >= c:
    print(a - c)
else:
    print(-1)

a = input().split(" ")
b = input().split(" ")
c = 0
for i in b:
    c += int(i)
if int(a[0]) >= c:
    print(int(a[0]) - c)
else:
    print(-1)


Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
n,m = map(int,input())
l = list(map(int,input().split()))
s = sum(l)
if n-s<0:
  print(-1)
else:
  print(n-s)

n,m = map(int,input().split())
l = list(map(int,input().split()))
s = sum(l)
if n-s<0:
  print(-1)
else:
  print(n-s)

Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
n, m = map(int, input().split())
A = list(map(int, input().split()))

sum = 0
for i in m:
  sum += A[i]

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

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

sum = 0
for i in range(m):
  sum += A[i]

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


Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
mn = input().split()
mn = [int(x) for x in mn]
n = mn[0]
m = mn[1]
a = input().split()
a  = [int(x) for x in a]


total = sum(a)
if n-total <0:
    print(-1)
else:
    prtin(n-total)

mn = input().split()
mn = [int(x) for x in mn]
n = mn[0]
m = mn[1]
a = input().split()
a  = [int(x) for x in a]


total = sum(a)
if n-total <0:
    print('-1')
else:
    prtin(n-total)

mn = input().split()
mn = [int(x) for x in mn]
n = mn[0]
m = mn[1]
a = input().split()
a  = [int(x) for x in a]


total = sum(a)
if n-total <0:
    print('-1')
else:
    print(n-total)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
N = int(input())
M = int(input())

sum = 0

for i in range(1,M+1):
    sum += int(input())

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

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)

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)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
n, m = map(int, input().split())
print(max(n - sum(list(map(int, input().split())))), -1)


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

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


Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):


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

def main():
    
    N,M = map(int,input().split())
    A = getIntList()

    for i in range(M):
        N += A[i]
    
    if N >= 0:
        print(N)
    else:
        print(-1)

    return

if __name__ == "__main__":
    main()



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

def main():
    
    N,M = map(int,input().split())
    A = getIntList()

    for i in range(M):
        N -= A[i]
    
    if N >= 0:
        print(N)
    else:
        print(-1)

    return

if __name__ == "__main__":
    main()

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
n = input().split()
m = input().split()
n = [int(i) for i in n]
m = [int(i) for i in m]

for i in m:
  n[0]=n[0]-i
  if n[0]<0:
    print("-1")
  else:
    print(n[0])

n = input().split()
m = input().split()
n = [int(i) for i in n]
m = [int(i) for i in m]
a = n[0]
for i in m:
  a -= i
  if a<0:
    print("-1")
  else:
    print(a)

n = input().split()
m = input().split()
n = [int(i) for i in n]
m = [int(i) for i in m]
a = n[0]
for i in m:
  a -= i
  
if a<0:
  print("-1")
else:
  print(a)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
NM = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]

N = NM[0]
M = NM[1]

if NM >= sum(A):
  print(NM-sum(A))
else:
  print(-1)


NM = [int(i) for i in input().split(" ")]
A = [int(i) for i in input().split(" ")]

N = NM[0]
M = NM[1]

if NM => sum(A):
  print(NM-sum(A))
else:
  print(-1)


NM = [int(i) for i in input().split()]
A = [int(i) fot i in input().split()]

N = NM[0]
M = NM[1]

if NM => sum(A):
  print(NM-sum(A))
else:
  print(-1)


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

N = NM[0]
M = NM[1]

if NM => sum(A):
  print(NM-sum(A))
else:
  print(-1)


NM = [int(i) for i in input().split(" ")]
A = [int(i) fot i in input().split(" ")]

N = NM[0]
M = NM[1]

if NM => sum(A):
  print(NM-sum(A))
else:
  print(-1)

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

N = NM[0]
M = NM[1]

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


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
if __name__ == '__main__':
    x=list(map(int,input().split(" ")))
    y = list(map(int, input().split(" ")))
    num=0
    for i in y:
        num+=i
    if x[0]<y:
        print(-1)
    else: print(x[0]-y)

if __name__ == '__main__':
    x=list(map(int,input().split(" ")))
    y = list(map(int, input().split(" ")))
    num=0
    for i in y:
        num+=i
    if x[0]<num:
        print(-1)
    else: print(x[0]-num)

Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
l=[list(map(int,input().split())) for _ in range(2)]
homework=0
for i in range(l[0][1]):
    homework=homework+l[1][i]
print(homework)
free=l[0][0]-homework
if free<0:
    print(-1)
else:
    print(free)

l=list(map(int,input().split()))
homework=0
for i in range(l[1]):
    homework=homework+l[i+2]
free=l[0]-homework
if free<0:
    print(-1)
else:
    print(free)

l=[list(map(int,input().split())) for _ in range(2)]
homework=0
for i in range(l[0][1]):
    homework=homework+l[1][i]
free=l[0][0]-homework
if free<0:
    print(-1)
else:
    print(free)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
n,m=map(int,input().split())
a=list(map(int,input().split()))
s=0
for i in a:
    s+=i
if s>a:
    print(-1)
else:
    print(a-s)

n,m=map(int,input().split())
a=list(map(int,input().split()))
s=0
for i in a:
    s+=i
if s>n:
    print(-1)
else:
    print(n-s)

Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
N, M = map(int, input().split())
A = sum(list(map(int, input().split())))
if A >= M:
    print(A-M)
else:
    print(-1)


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


Verdicts: Wrong Answer

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
n, m = map(int, input().split())
a = list(map(int, input.split()))
s = sum(a)
if n < s:
  print(-1)
else:
  print(n - a)

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

Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
N,M  = map(int, input().split())
A_list = list(map(int, input.split()))

avail = N - sum(A_list)

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

N,M  = map(int, input().split())
A_list = list(map(int, input().split()))
 
avail = N - sum(A_list)
 
if avail >= 0: 
  print(avail)
  
else:
  print(-1)

Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):

def resolve():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    print(N - sum(A))

if __name__ == "__main__":
    resolve


def resolve():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    ans = N - sum(A)
    if ans < 0:
        print(-1)
    else:
        print(ans)


if __name__ == "__main__":
    resolve()

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):

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


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

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
N,M=map(int,input().split())
A=list(map(int,input().split()))

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

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

if N>=B:
    print(N-B)
else:
    print(-1)

Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
N,M = map(int,input().split())
lst = list(map(int,input().split()))
plus = 0
for a in range(lst):
    plus += a
if plus <= N:
    print(N-plus)
else:
    print('-1')

N = int(input())
M = int(input())
lst = []
for i in range(M):
    lst.append(int(input()))
plus = 0
for a in lst:
    plus += a
if plus <= N:
    print(N-plus)
else:
    print('-1')

N,M = map(int,input().split())
lst = list(map(int,input().split()))
plus = 0
for a in lst:
    plus += a
if plus <= N:
    print(N-plus)
else:
    print('-1')

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
n = int(input())
m = int(input())
l1 = []
for i in range (m):
    a1 = int(input())
    l1.append(a1)
s = sum(l1)
r = n - s
print(r)

n = int(input())
m = int(input())
l1 = []
for i in range (m):
    a1 = int(input())
    l1.append(a1)
s = sum(l1)
r = n - s
if r >= 0:
    print(r)
else:
    print("-1")

n = int(input())
m = int(input())
l1 = []
for i in range (m):
    ai = int(input())
    l1.append(ai)
s = sum(l1)
r = (n - s)
if r >= 0:
    print(r)
else:
    print("-1")

n = int(input())
m = int(input())
l1 = []
for i in range (m):
    a1 = int(input())
    l1.append(a1)
s = sum(l1)
result = n - s
print(result)

n, m = map(int, input().split())
ai = map(int, input().split())
li = map(int, list(ai))
s = sum(li)
r = (n - s)
if r >= 0:
    print(r)
else:
    print("-1")

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
def readinput():
    n,m=map(int,input().split())
    a=list(map(int,input().split()))
    return n,m,a

def main(n,m,a):
    days=sum(a)
    if days<n:
        return -1
    else:
        return n-days

if __name__=='__main__':
    n,m,a=readinput()
    ans=main(n,m,a)
    print(ans)


def readinput():
    n,m=map(int,input().split())
    a=list(map(int,input().split()))
    return n,m,a

def main(n,m,a):
    days=sum(a)
    if days>n:
        return -1
    else:
        return n-days

if __name__=='__main__':
    n,m,a=readinput()
    ans=main(n,m,a)
    print(ans)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
day, assignment = map(int, input().split())
assignment_time = map(int, input().split())
if sum(assignment_time) > N:
    print(-1)
else:
    print(N - sum(assignment_time))

day, assignment = map(int, input().split())
assignment_time = map(int, input().split())
if sum(assignment_time) > day:
    print(-1)
else:
    print(day - sum(assignment_time))

day, assignment = map(int, input().split())
assignment_time = map(int, input().split())
if sum(assignment_time)<0:
    print(-1)
else:
    print(sum(assignment_time))

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

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
R = int(input())

print(2*R*3.1415926535897)

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

x = N-(sum(A))

print(-1 if x < 0 else x)

Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
timeofholiday=int(input())
sum=0
homework_num=int(input())
for i in range(homework_num):
  a=int(input())
  sum+=a
  
if sum > timeofholiday:
  print("-1")
else:
  print(timeofholiday-sum)

input_= list(map(int, input().split()))
timeofholiday=input_[0]
sum=0
homework_num=input_[1]
que=list(map(int, input().split()))
for i in que:
  sum+=i
  
if sum > timeofholiday:
  print("-1")
else:
  print(timeofholiday-sum)

Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
import math
R = int(input())
L = math.pi*2*R
print(L)

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

Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np

def main():
    N, M, *A = map(int, read().split())
    ans = sum(A)
    if ans > N:
        ans == -1
    print(ans)
    return

if __name__ == '__main__':
    main()



import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np

def main():
    N, M, *A = map(int, read().split())
    ans = sum(A)
    if ans > N:
        ans = -1
    else:
        ans = N - ans
    print(ans)
    return

if __name__ == '__main__':
    main()



Verdicts: Wrong Answer

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
N,M = map(int, input().split())
A = [0] * M
for i in M:
  A[i] = int(input())
  N -= A[i]

if N < 0:
  N = -1

print(N)

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

Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
if __name__ == '__main__':
    N, M = [int(x) for x in input().split()]
    arr = [int(x) for x in input().split()]
    res = N - sum(arr)
    if res < 0:
        print(-1)
    else:


if __name__ == '__main__':
    N, M = [int(x) for x in input().split()]
    arr = [int(x) for x in input().split()]
    res = N - sum(arr)
    if res < 0:
        print(-1)
    else:
        print(res)


Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
N,M = map(int, input().split())
A = list(map(int, input().split()))

ans = max(N - sum(A))
print(ans)

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

print(max(-1, N - sum(A)))

Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
s = input().split(" ")
N = int(s[0])
M = s[1]
s = input().split(" ")
A = []
sum = 0
for w in s:
    A.append(int(w))
    sum += int(w)

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

s = input().split(" ")
N = int(s[0])
M = s[1]
s = input().split(" ")
A = []
sum = 0
for w in s:
    A.append(int(w))
    sum += int(w)

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

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
import math
a = input().split()
b = map(int,input().split())
if (sum(b) > int(a[0])):
    print("-1")
else:
    print(int(a[0]) - sum(b)) 

import math
a = input().split()
b = map(int,input().split())
c = int(a[0])-sum(b)
if (c < 0):
    print("-1")
else:
    print(c) 

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
n,m=map(int,input().split())
a=list(map(int,input().split()))
for i in range(m):
    m-=a[i]
if m>=0:
    print m
else:
    print -1

n,m=map(int,input().split())
a=list(map(int,input().split()))
for i in range(m):
    n-=a[i]
if n>=0:
    print (n)
else:
    print (-1)

Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
n,m = int(input().split())
a = int(input().split())
if sum(a)>n:
  print('-1')
else:
  print(n-sum(a))

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

Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
a,b=map(int,input().split())
list_=[]
for i in range(b):
  c=int(input())
  list_.append(c)
d=sum(list_)
print(a-d)

    


a,b=map(int,input().split())
c=list(map(int,input().split()))
d=sum(c)
ans=a-d
if ans>=0:
    print(ans)
else:
    print('-1')


    





Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
f = open('input.txt', 'r')
sys.stdin = f

N, M = map(int, input().split())
As = list(map(int, input().split()))
d = sum(As)
if N < d:
    print(-1)
else:
    print(N-d)


import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
f = open('input.txt', 'r')
sys.stdin = f

N, M = map(int, input().split())
As = list(map(int, input().split()))
d = sum(As)
if N < d:
    print(-1)
else:
    print(N-d) 


N, M = map(int, input().split())
As = list(map(int, input().split()))
d = sum(As)
if N < d:
    print(-1)
else:
    print(N-d)


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
import sys

def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())

n, m = ISI()
l=ILI()
if n-sum8(l)<:print(-1)
else:print(n-sum(l))

import sys
def ISI(): return map(int, sys.stdin.readline().rstrip().split())

n, m = ISI()
l=ILI()
print(n-sum(l))

import sys

def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())

n, m = ISI()
l=ILI()
if n-sum(l)<0:print(-1)
else:print(n-sum(l))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
# -*- coding: utf-8 -*-

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

ans = n - sum(a)

if ans < 0:
    return -1
else:
    return ans


# -*- coding: utf-8 -*-

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

ans = n - sum(a)

if ans < 0:
    print(-1)
else:
    print(ans)


Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
N, M=map(int,input.split())
a=list(map(int,input.split()))
if N-sum(a)>=0:
  print(N-sum(a))
else:
  print(-1)
  

N, M=map(int,input.split())
a=[map(int,input.split())]
if N-sum(a)>=0:
  print(N-sum(a))
else:
  print(-1)
  

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
from sys import stdin
N,M = stdin.readline().rstrip().split()
a_list = stdin.readline().rstrip().split()
N,M = int(N),int(M)
for a in a_list:
  N-=int(a)
if(N>0):
  print(N)
print(-1)


from sys import stdin
N,M = stdin.readline().rstrip().split()
a_list = stdin.readline().rstrip().split()
N,M = int(N),int(M)
for a in a_list:
  N-=int(a)
if(N>=0):
  print(N)
print('-1')

from sys import stdin
N,M = stdin.readline().rstrip().split()
a_list = stdin.readline().rstrip().split()
N,M = int(N),int(M)
for a in a_list:
  N-=int(a)
if(N>=0):
  print(N)
else:
	print('-1')

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
N = int(input())
M = int(input())

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

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

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

Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
# 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)

# 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)

# 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)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
import sys
N,M = list(map(int, sys.stdin.readline().rstrip().split())) 
A = list(map(int, sys.stdin.readline().rstrip().split())) 

s = 0
for n in range(M):
  s += A[n]
  
s -= N
if s < 0:
  print(-1)
else:
  print(s)


N,M = list(map(int, sys.stdin.readline().rstrip().split())) 
A = list(map(int, sys.stdin.readline().rstrip().split())) 

s = 0
for n in range(M):
  s += A[n]
  
s -= N
if s < 0:
  print(-1)
else:
  print(s)

import sys
N,M = list(map(int, sys.stdin.readline().rstrip().split())) 
A = list(map(int, sys.stdin.readline().rstrip().split())) 

s = 0
for n in range(M):
  s += A[n]
  
s = N - s
if s < 0:
  print(-1)
else:
  print(s)


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
from b import resolve
import sys
from io import StringIO
import unittest

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """41 2
5 6"""
        output = """30"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """10 2
5 6"""
        output = """-1"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """11 2
5 6"""
        output = """0"""
        self.assertIO(input, output)
    def test_入力例_4(self):
        input = """314 15
9 26 5 35 8 9 79 3 23 8 46 2 6 43 3"""
        output = """9"""
        self.assertIO(input, output)
    def test_Sample_Input_1(self):
        input = """41 2
5 6"""
        output = """30"""
        self.assertIO(input, output)
    def test_Sample_Input_2(self):
        input = """10 2
5 6"""
        output = """-1"""
        self.assertIO(input, output)
    def test_Sample_Input_3(self):
        input = """11 2
5 6"""
        output = """0"""
        self.assertIO(input, output)
    def test_Sample_Input_4(self):
        input = """314 15
9 26 5 35 8 9 79 3 23 8 46 2 6 43 3"""
        output = """9"""
        self.assertIO(input, output)

if __name__ == "__main__":
    unittest.main()

import sys
input = lambda: sys.stdin.readline().rstrip() 

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

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

if __name__ == '__main__':
    resolve()


Verdicts: Runtime Error

Accepted