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):
N,M = map(int,input().split())
A = [int(x) for x in input().split()]

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

N,M = map(int,input().split())
A = [0] * M
A = [int(x) for x in input().split()]

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

N,M = map(int,input().split())
A = [int(x) * M for x in input().split()]

if N - sum(A) >= 0:
    print(N - A.sum())
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

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

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)

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)

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


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)

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):
import sys

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

A = []
for l in sys.stdin:
    A.append(int(l))
    
need_day = sum(A)
    
if N < need_day:
    print(-1)
else:
    print(N-need_day)

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

need_day = sum(A)

if N < need_day:
    print(-1)
else:
    print(N-need_day)


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(int(input()).split())
tmp = n-sum(A)

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

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

if tmp >= 0:
  print(tmp)
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=map(int,input().split(" "))
Ai=map(int,input().split(" "))
n=a[0]
days=0
for i in range(a[1]):
    days+=Ai[i]
if days>n:
    print(-1)
else:
    print(n-days)

a=map(int,input().split(" "))
Ai=map(int,input().split(" "))
n=a[0]
days=0
for A in Ai:
    days+=A
if days>n:
    print(-1)
else:
    print(n-days)

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

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())
plan = list(map(int,input().split()))
sum = N
for i in range(M):
  sum = sum - plan[i]

if sum >= 0:
  print(plan)

else:
  print('-1')

N,M = map(int,input().split())
plan = list(map(int,input().split()))
sum = N
for i in range(M):
  sum = sum - plan[i]

if 0 <= sum <= N:
  print(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 sys
sys.setrecursionlimit(10000000)

#const
dxdy=((1,0),(0,1))
#my functions here!
def pin(type=int):
    return map(type,input().rstrip().split())
from math import gcd

#your code here!
def resolve():
    N,M=pin()
    A=(pin())
    t=(N)-sum(A)
    #print(t)
    ans=t if t>-1 else -1
    print(ans)

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)


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

"""
    I wrote my code above!
"""
    resolve()#and submit 2 atcoder!



import sys
sys.setrecursionlimit(10000000)

#const
dxdy=((1,0),(0,1))
#my functions here!
def pin(type=int):
    return map(type,input().rstrip().split())
from math import gcd

#your code here!
def resolve():
    N,M=pin()
    A=(pin())
    t=(N)-sum(A)
    #print(t)
    ans=t if t>-1 else -1
    print(ans)

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)


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


    resolve()



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 = input().split(" ")
tm = 0
for i in range(int(M)):
    i = input()
    tm = tm + int(i)
print(int(N)-tm)

a,b=map(int,input().split())
c=list(map(int,input().split()))
d=sum(c)
print(a-d if a-d>=0 else -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 = [list(map(int,input().split()))]
print(A)
SUM = sum(A[0])
if SUM>N:
    print(-1)
else:
    print(N-SUM)

N,M = map(int, input().split())
A = [0]*M
for i in range(M):
    A[i] = int(input())
SUM = sum(A)
if SUM>N:
    print(-1)
else:
    print(N-SUM)

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)

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)

Verdicts: Wrong Answer

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())
         
t = sum(A)
if N < t:
  print(-1)
else:
  print(N-A)

r = int(input())
import math
print(2*r * math.pi)

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

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

Verdicts: 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):
N, M = input().split()

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

a = input().split()

a = int(a)


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

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

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)

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):
M, N= input().split()
A1, Am = input().split()
if 1 <= int(N) < 10**6 and 1 <= int(M) < 10**4 and 1 <= int(A1) < 10**4 :
    if((int(A1) + int(Am)) <= int(M)):
        print((int(A1)+int(Am))-int(M))
    elif (int(A1) + int(Am)) == int(M):
        print(0)
    elif (int(A1)+int(Am)) > int(M):
        print(-1)

M, N = map(int ,input().split())
x = [int(x) for x in input().split()]
if (sum(x)) > M:
    print(-1)
elif(sum(x) == M):
    print(0)
elif(sum(x)<M):
    print(M-sum(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):
n,m=(int(i) for i in input().split())
l=[int(i) for i in input().split()]
if(sum(l)>=n):
	print(n-sum(l))
else:
	print(-1

n,m=(int(i) for i in input().split())
l=[int(i) for i in input().split()]
if(sum(l)<=n):
	print(n-sum(l))
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)
lis=list(map(int, input().split()))
s=0
for i in lis:
    s+=i
if N-s<0:
    print("-1")
else:
    print(N-s)

N,M=map(int,input().split())
lis=list(map(int, input().split()))
s=0
for i in lis:
    s+=i
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())
homework = list(map(int,input().split()))

if n >= sum(homework):
  print(n-sum(homework))

else:
  print(-1)

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

if n >= sum(homework):
  print(n-sum(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):
#ABC163B
n,m = map(int,input().split())
a = list(map(int,inout().split()))
print(-1 if sum(a) >= n else n-sum(a))

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

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)


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

s = sum(A)

if s > N:
    print(-1)
else:
    print(N - s)
print(-1)

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

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

s = sum(A)

if s > N:
    print(-1)
else:
    print(N - s)

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 = sum(map(int,input().split()))

print(N-A if N<=A else -1)


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

print(N-A if N>=A else -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=int(input())
n,k=map(int,input().split())
a=list(map(int,input().split())) 
ans=0
for i in range(n):
    ans+=a[i]
if ans<=n:
    print(n-ans)
else:
    print('-1')

import sys
input = sys.stdin.readline
def main():
  n=int(input())
  n,m=map(int,input().split())
  a=list(map(int,input().split())) 
  ans=0
  for i in range(m):
    ans+=a[i]
  if ans<=n:
      print(n-ans)
  else:
      print('-1')
main()

import sys
input = sys.stdin.readline
def main():
  n,m=map(int,input().split())
  a=list(map(int,input().split())) 
  ans=0
  for i in range(m):
    ans+=a[i]
  if ans<=n:
      print(n-ans)
  else:
      print('-1')
main()

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):
a,b=map(int,input().split())
c=input().split()
if sum(int(i) for i in c)>a:
    print(-1)
else:
    print(a-sum(int(i)) for i in c)

N,M=map(int,input().split())
c=input().split()
if sum(int(i) for i in c)>N:
    print(-1)
else:
    print(N-sum(int(i) for i in 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()))
print(a)
for i in range(m):
    n=n-a[i]
if(i>=0):
    print(n)
else:
    print(-1)

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

n,m = map(int,input().split())
a = list(map(int,input().split()))
for i in range(m):
    n=n-a[i]
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,m=map(int,input().split())
mm=[]
for i in range(m):
    s=int(input())
    mm.append(s)
a=n-sum(mm)
if a>=0:
    print(a)
else: print(-1)

n,m=map(int,input().split())
mm=list(map(int,input().split()))
a=n-sum(mm)
if a>=0:
    print(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):
import numpy as np
N,M = map(int,input().split())
A = [int(a) for a input().split()]

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

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


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

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


m = int(M **2 * 1/2 + M *1/2)

if N > m:
    print(N-m)

else:
    print(-1)



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


m = int(M **2 * 1/2 + M *1/2)

if N >= m:
    print(N-m)

else:
    print(-1)



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


m = int(M **2 * 1/2 + M *1/2)

if N > m:
    print(N-m)

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: Wrong Answer

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):
m = int(input())
n = int(input())
a = list(map(int,input().split()))

ans = m - sum(a)

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

m_n = list(map(int,input().split()))
m = m_n[0]
n = m_n[1]
a = list(map(int,input().split()))
 
ans = m - 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):
inputdata = list(map(input().split()))
# data = list(map(int, "41 2 5 6".split()))

N = data[0] # days of summer vacation
M = data[1] # summer assignments

A = 0 # days to do the i-th assignment.

for i in range(2, M+2) :
    # print(data[i])
    A += data[i]

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

data = list(map(int, input().split()))
# data = list(map(int, "41 2 5 6".split()))

N = data[0] # days of summer vacation
M = data[1] # summer assignments

A = 0 # days to do the i-th assignment.

for i in range(2, M+2) :
    # print(data[i])
    A += data[i]

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

data = list(map(int, input().split()))
# data = list(map(int, "41 2".split()))

N = data[0] # days of summer vacation
M = data[1] # summer assignments

A = 0 # days to do the i-th assignment.

assignments = list(map(int, input().split()))
# assignments = list(map(int, "5 6".split()))

if sum(assignments) <= N :
    print(N-sum(assignments))
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())
a=[]
for i in range(0,m):
    a[i] = input()
    n-=a[i]
if n<=0:
    print(-1)
else:
    print(n)

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

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

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

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

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

Verdicts: Runtime Error

Runtime Error

Wrong Answer

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=list(map(int,input().split()))
if n>=sum(a):
  print(n-sum(a))
else:
  print(-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):
n, m = map(int, input().split())
a = [int(i) for i in input().split()]
if sum(a) > n: b = n - sum(a)
else: b = -1
print(b)

n, m = map(int, input().split())
a = [int(i) for i in input().split()]
b = n - sum(a)
if b < 0: b = -1
print(b)

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

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


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


n, m = map(int, input().split())
a = list(map(int, input().split()))
total = sum(a)
if total <= n:
    print(n - total)
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,m=map(int,input().split())
li=[]
for ai in range(m):
    ai=map(int,input().split())
    li.append(ai)
k=sum(li)
if k<=n:
    print(m-k)
else:
    print("-1")

n,m=map(int,input().split())
li=[]
for ai in range(m):
    ai=int(input())
    li.append(ai)
k=sum(li)
if k<=n:
    print(m-k)
else:
    print("-1")

n,m=map(int,input().split())
for ai in range(m):
    ai=list(int(input()))
    k=sum(ai)
if k<=m:
    print(m-k)
else:
    print("-1")

n,m=map(int,input().split())
for ai in range(m):
    ai=list(map(int,input().split())
    k=sum(ai)
if k<=n:
    print(m-k)
else:
    print("-1")

n,m=map(int,input().split())
li=[]
ai=map(int,input().split())
li.append(ai)
k=sum(li)
if k<=n:
    print(n-k)
else:
    print("-1")

n,m=map(int,input().split())
ai=list(map(int,input().split()))
k=sum(ai)
if k<=n:
    print(n-k)
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):
atcoder-tools: The pre-rendered templates are not found.#!/usr/bin/env python3
import sys


def solve(N: int, M: int, A: "List[int]"):
    play = N - sum(A)
    if play > -1:
        print(play)
    else:
        print(-1)


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(M)]  # type: "List[int]"
    solve(N, M, A)

if __name__ == '__main__':
    main()


#!/usr/bin/env python3
import sys


def solve(N: int, M: int, A: "List[int]"):
    play = N - sum(A)
    if play > -1:
        print(play)
    else:
        print(-1)


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(M)]  # type: "List[int]"
    solve(N, M, A)

if __name__ == '__main__':
    main()


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):
int a[10010];
int main(){
    int n,m;
    scanf("%d%d",&n,&m);
    for(int i=0;i<m;i++)scanf("%d",&a[i]);
    int s=0;
    for(int i=0;i<m;i++)s+=a[i];
    if(s>n){
        printf("-1\n");
    }else{
        printf("%d\n",n-s);
    }
}

import numpy as np
 
N, M = map(int, input().split())
A = []
A = map(int, input().split())
 
dif = N - sum(A)
 
if dif >= 0:
  print(dif)
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(x) for x in input.split())

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

hwsum = 0

for n in range(len(hw)-1):
  hwsum += hw[n]

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

N,M = (int(x) for x in input.split())

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

hwsum = 0

for n in range(len(hw)-1):
  hwsum += hw[n]

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


N,M = (int(x) for x in input().split())

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

hwsum = 0

for n in range(len(hw)):
  hwsum += hw[n]

if hwsum<=N:
  print(N-hwsum)
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):
days,num = map(int,input().split())
homeworks = list(map(int,input().split()))

temp = sum(homeworks)

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


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

temp = sum(homeworks)

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


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 = input().split()
A_int = [int(n) for n in A]

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

A = []

N = input()
M = input()
for i in range(M):
  A = A.append(input())
rest = N - sum(A)

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

N, M = map(int, input().split())
A = input().split()
A_int = [int(n) for n in A]

rest = sum(A_int)
if rest >= 0:
  print(rest)
else:
  print(-1)

N, M = map(int, input().split())
A = input().split()
A_int = [int(n) for n in A]

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

Verdicts: Wrong Answer

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 = input().split()
A = list(map(int, input().split()))

S =sum(A)

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

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

S =sum(A)

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

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

if N-S >=0:
    print(N-S)
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())
a = list(map(int,input().split()))
sum = 314
for i in a:
  sum -= i
if sum < 0:
  print(-1)
else:
  print(sum)

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

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



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 = list(map(int, input().split())
print(max(n - sum(list(map(int, input().split()), 0))

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

n, m = list(map(int, input().split()))
print(max(n - sum(list(map(int, input().split()))), -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):
tot , n = list( map ( int ,input().split()))
a = list( map( int , input().split()))
if tot >= a.sum():
	print(tot -a.sum())
else:
	print(-1)

tot , n = list( map ( int ,input().split()))
a = list( map( int , input().split()))
if tot >= sum(a):
	print(tot -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):
NM = list(map(int, input().split()))
N = NM[0]
M = NM[1]
Alist = []
for i in range(M):
    Alist.append(int(input()))
daysNeeded = sum(Alist)
if daysNeeded>N:
    print(-1)
else:
    print(M - daysNeeded)

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

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())
a = [int(x) for x in input().split()]
s = sum(a)
if n < s:
  print("-1")
else:
  print(n-s)

n,m = map(int,input().split())
a = [int(x) for x in 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):
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()


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


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

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

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):
a, b = map(int, input().split())
l = list(map(int, input().split()))
if sum(l) < a:
	print('-1')
else:
	print(a-sum(l))


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

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 = [int(s) for s in input().split()]
A = [int(s) for s in input().split()]
days = N - sum(A)
days = -1 if days < 0 else -1
print(days)

N, M = [int(s) for s in input().split()]
A = [int(s) for s in input().split()]
days = N - sum(A)
days = '-1' if days < 0 else days
print(days)

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()))
ct = 0
for i in range(m):
    ct += a[i]

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


n, m = map(int, input().split())
a = list(map(int, input().split()))
ct = 0
for i in range(m):
    ct += a[i]

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


Verdicts: Runtime Error

Accepted