peterverebics/CodeNet_Python_118 huggingface dataset:
import sys

def main():

	R = int(input())
	print(R*3.14159)

if __name__ == "__main__":
    main()
import sys
import io
import math
def readlines():
    for line in io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8'):
        yield line.strip('\n')

lines = readlines()

n = int( next(lines))
print(math.pi *n)
pi = 3.14159265

r = int(input())

x = r*r*pi

print(x)
import math 
str = input().strip()
print(int(str)*math.pi)
R=input()
R=int(R)
R*2*3.14
print(R)
N = int(input())
my_result = N * 3.14159265
print(my_result)
import math

def Main():
    n = int(input())
    
    print( n * math.pi )

if __name__ == "__main__":
    Main()
##入力

R = int(input())
"""
1 ##数字 integer -> int
"1" ##文字列 string -> str
"""
##計算

L = 2*R*3

##出力

print(L)
import math

def main():
    r = int(input())
    print(math.pi * r ** 2)


if __name__ == "__main__":
    main()
r = int(input())
s = r*2*3.1415926535

print(r+s)
import math
P=math.pi
R=int(input('とりま入れてみ'))
print(2*math.pi*R)
R=1
π='3.14'
Circle_Pond=2*R*float(π)
print(Circle_Pond)
import math
def round(x):
    return 2* math.pi * x
R = int(input())
if __name__== "__maib__":
    print(round(R))
R = int(input())
C = 6.18 * R
print(C)
import math as ma
RI = int(input())
L = 2*ma.pi*RI
print(RI)
if __name__ == '__main__':
    N = int(input())
    print(N*N*3.1428)
R=input()

R=float(R)
s=print(R*2*3.14)
print(s)
PI = 3.14159265
def circumference(r):
    return (2 * PI * r)
print('%.3f' % circumference(73))
import math
R = int(input("Enter the radius: "))
C = 2 * math.pi * R
print(C)
r = int(input())
pi = 3.14159265358979
print(r*r*pi)
import math
a = int(input(">"))
print(a * 2 * math.pi)
R = int(input("Enter a radius value: "))
# check value constraint
while R<1 or R>100:
    R = int(input("Please enter a radius value between 1 ot 100: "))

pi = 3.1415926535897932384626433832795
c = 2*pi*R
print(c)
R = int(input())
ennsyuu = R * 3.14159265358979323846
print(ennsyuu)
import math

R = int(input())
print(R)
l = 2 * math.pi * float(R)
print(l)
R=1
Circle_Pond=2*R*float(input(3.14))
import sys
input = sys.stdin.readline
def main():
    N = int(input())
    A = [x for x in input().split()]
    l = [0] * N
    B = set(A)
    C = list(B)
    for i in C:
        l[int(i)-1] = A.count(i)
    for i in range(N):
        print(l[i])
        
main()
import math
x = int(input())
ans = x*math.pi
print(ans)
n = int(input("enter :" ))
print( 2 * n * 3.14 )
from math import pi
inp = int(input())
ans = inp **2 * pi
print(ans)
def getLapLen(radius):
    return radius*radius*3.141592

param = int(input())
print(getLapLen(param))
import math

r = int(input())

def circumfrence(r):
  return (2*pi*r)
R = input()
R = int(R)
print(R * R * 3.14)
import math

R = float(input())
round(2*math.pi*R, 2)
from sys import stdin

def main():

    input = stdin.readline

    N = int(input())
    A = list(map(int,input().split()))
    ans = [0] * N

    for i in range(N):
        print(A.count(i+1))
    # for i in range(N-1):
    #     ans[A[i]-1] += 1

    # for i in ans:
    #     print(i)

if __name__ == "__main__":
    main()
import numpy as np
a=int(input())
pi = 4 * np.arctan(1) #変数piに4*tanh(1)を代入
b=a*pi
print(b)
import math 

def resolve():
    r = int(input())
    a = 2*r*math.pi
    print(a)
import math


for i in range(1,101):
  print(2*(math.pi)*i)
import math
import sys
N = int(sys.stdin.readline())

print(N * N * math.pi)
#=input()
r=int(input())
#=map(int,input().split())
#=map(str,input().split())
#=list(map(int,input().split()))
print(r*3.14)
import numpy
R = int(input())

print(R**2 * numpy.pi)
import numpy as np
print(np.pi)

import numpy as np
r = int(input())
 
print(r*2*np.pi)
r = float(input())
ans = r**2*3.14
print(ans)
r = int(input())
print(r * 3.14159 / 2)
n = float(input())
pi = 6.28318530717958623200 / 2
print(n*pi)
R=int(input('とりま入れてみ？'))
P=3.1415926535
answer=2*R*P
print(answer)
import math

R = int(input())
ans = math.pi * R

print(ans)
r=int(input())
ans=r**2*3.141592
print(ans)
# -*- coding: utf-8 -*-
#半径の入力
R=int(input("R"))
#半径に2と円周率をかけて円周を導出
Round=6.283*R
#円周の出力
print(Round)
import math

def main():
  R = input()
  answer = float(R) * 2 / math.pi
  print(answer)
  
if __name__ == '__main__':
  main()
import math
R = int(input())
ensyu = R*math.pi
print(ensyu)
import math

r = int(input())

print(int(r) * int(r) * math.pi)
a = int(input("Nunber"))
b = 2 * a * 3.141592
print(b)
from math import pi   
    
def circle():
    radius = input('半径Rを入力してね')
    try:
        radius = int(radius)

    except:
        print('整数を入力してね')
        return circle()
    
    if radius<1 or radius>100 :
        print('１以上１００未満の整数を入力してね')
        return circle()
    
    else :
        return radius
        
print ('周長は{}です'.format(2*circle()*pi))
R=int(input('とりま入れてみ？'))
P=3.1415926535
answer=R*R*P
print(answer)
import math
r=int(input())
C=2*math.pi*r
print(C)
print(round(C,2))
import math
n=int(input())
def func(n):
    return math.pi*n*2
print(n)
def main():
    n = int(input())
    return n*3.14
    


    
if __name__ == '__main__':
    main()
import math
r=int(input())
a=math.pi
print(r*a)
def resolve():
    r = int(input())
    print(r ** 2 * 3.1415)
    
resolve()
pi=3.14159265358979
r=int(input())
print(r*pi)
import math
r = int(input())
area = math.pi*r*r
print(area)
pi=3.142857143
R=int(input())
C=float(2*pi*R) 
print ("c")
import sys
input = sys.stdin.readline
n = int(input())
a = [int(i) for i in input().split()]
del a[n:len(a)-1]
result = []
for i in range(n):
    print(a.count(i+1))
import math

n = int(input())
ans = math.pi*n
print(ans)
import math
R = input()
r = float(R)
print(math.pi * r)
import math as mt
r = int(input())
R = r*mt.pi
print(R)
R = int(input("Enter a radius value: "))

pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286
c = 2*pi*R
print(c)
import math

R = input("Enter the radius: ")
def circle_round(radius):
    return 2 * math.pi * radius
print(circle_round(3))
# -*- coding: utf-8 -*-
import math
#半径の入力
R=int(input("R"))
#半径に2と円周率をかけて円周を導出
Round=2*math.pi*R
#円周の出力
print(Round)
n = float(input())
pi = 3.14159265358979
print(n*pi)
import math
math.pi

x=int(input())
x=x*2*math.pi
x
R = float(input())
ret = R * 3.141592
print(ret)
R = int(input("Enter a radius value: "))
pi = 3.1415926535897932384626433832795
c = 2*pi*R
print(c)
R = float(input())
P = 3.141592653589
print(R * P)
r = int(input())
print(3.1415926535897 * r**2)
R = int(input())
pi = float('3.141592')
print(R * pi)
PI=3.1415926535
r=int(input())
l=r**2*PI
print(l)
import math
def number(R):
    return 2 * math.pi * R
  
numbers = map(number,range(1,100))
print(list(numbers))
#cording:utf-8
 
import math
 
R=float(input())
L=2*math.pi*R
print("L={0}".format(L))
r=int(input())
pi=3.14159265359
C=2*pi*r
print("C")
print(round(C,2))
import math

s=input()
l=float(2*s)*math.pi
print(l)
R = int(input())

print(R)
print(R ** 2 * 3.14)
R =float(input())
print("2 * 3.1415926535 * R")
R =int(input())
print("2 * 3.1415926535 * R")
R = input()
print(2*3.141*((int(R))**2))
import math
R = int(input())
L = R*math.pi
print(L)
#ABC163a
r = int(input())

print(3.14159265*r**2)
import math

def circumference(r):
  return (math.pi) * 2 * r
import math
math.pi

def CR(R):
  if 1 <= R <= 100:
    return 2 * math.pi * R
  else:
    return None
import math
r = int(input())
area = math.pi * 2 * r 
print(r)
import math

r = int(input())
s = math.pi*r
print(s)
#cording:utf-8
import math

R=int(input())
L=2*math.pi*R

print("L={0}".format(L))
import math
 
r = int(input())
 
print(r*math.pi)
# -*- coding: utf-8 -*-
# 整数の入力
a = int(input())
# 出力
print(a*a*3.14)
import numpy as np
pi = np.pi
R = int(input())

print(R * pi)
from math import pi
inp = int(input())
ans = inp * inp * pi
print(ans)
R = int(input())

pi = 3.14159265359 

s = pi * R

print(s)
import math
r = int(input())
print(2 * r * r * math.pi)
import math
s=int(input())
s=s*math.pi
print(s)
pi = 3.1415926535897932384626433
n = int(input())
print(n*pi)
import math 
R = int(input())

print(R*R*math.pi)
import math

r = input("半径")

r = float(r)

r = r*2*math.pi

print(r)
import numpy as np #numpyをインポート
a=int(input())
pi = np.pi #変数piにnp.piを代入
b=a*pi
print(b)
R = int(input("半径を入力してください"))

import math

R = R * 2 * math.pi

print(R)
import math

for i in range(1,101):
  print(2*(math.pi)*i)
n = float(input())

m = n * n * 3.1415

print(m)
from sys import stdin

n = int(stdin.readline().rstrip())

print(n*3.14159265)
input1 = int(input())

print(input1 * 3.14159265358979)
import math
 
r=int(input())
print(int(2*r*math.pi))
s = input("R=")
a = 2*3.1415926535*float(s)
print(a)
import math
def sq(r):
  return math.pi * math.pow(r,2)
r = float(input())
print(sq(r))
# coding:utf-8
import math

a=int(input())
b=math.pi

c=2*1*b

print(c)
from math import pi
def cicle(hankei):
    print(2 * hankei * pi)
r = int(input())
ans = 44*100*r/7
ans = ans//1
print(ans)
import math
n = float(input())
pi = math.pi
print(n*pi)
import math
R = range(1,100)
def circle(R):
    return(2 * math.pi * R)
R = input()
x = int(R)

print(x)
print(x * 2 * 3.14)
from math import comb, factorial, gcd, isqrt, perm, exp, log, log2, log10, sqrt, pi, acos, asin, atan ,atan2, cos, sin, tan
print(int(input())*pi)
r = int(input())
ans = r**2*3.14
print(ans)
R = int(input("Enter the radius of R: "))
C = 2 * 3.141592653589793238 * R
print(f"The circumference is {C}")
import numpy as np

r = int(input())

l = 2.0*r*np.pi
import math
r = int(input())
ans = r * r * math.pi
print(ans)
r=int(input())
Pi=3.14159265358979323846
print(r*Pi)
from math import pi

r = int(input())

print(int(r) * int(r) * pi)
import math
r = int(input())
def cir(r):
  return math.pi*r**2
print(cir(r))
R=float(input('とりま入れてみ？'))
P=3.1415
answer=R*R*P
print(answer)
import math
x = math.pi
a=input().split()
n = int(a[0])
print(n*x)
import cmath as cc
n=int(input())
print(cc.pi*n)
if __name__ == '__main__':
    N = int(input())
    import math
    print(N*N*(math.pi))
PI = 3.141

r = float(input().strip())

print(r*PI)
import math
class Solution:
    def maxNumberOfBalloons(n, text: int) -> int:
        return 2 * math.pi * n
import sys
import numpy as np
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    R = int(readline())
    ans = R * np.pi
    print(ans)

if __name__ == '__main__':
    main()
from math import pi
R = int(input())
print("%.2d" %(2 * pi * R))
import math

r = int(input())
  
  
print(r*math.pi)
import math
R = int(input())
pi = math.pi
print(R * pi)
#cording:utf-8
import math
R=float(input())
L=2*math.pi*R
print("L={0}".format(L))
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
sys.setrecursionlimit(10**7)
from pprint import pprint as pp
from pprint import pformat as pf

import math
#from sortedcontainers import SortedList, SortedDict, SortedSet # no in atcoder
import bisect


if __name__ == '__main__':
    r = int(input())
    ans = 2 * r * math.pi
    print('ans') # debug
    print(ans)

    print('\33[32m' + 'end' + '\033[0m') # debug
print(int(input()) * 3.141592653589793238462643383279502884197169399375105820974944)
import math
r = int(input())
pi = math.pi
print(pi*r**2)
import math
r = int(input("Enter a radius value: "))
# check value constraint
while r<1 or r>100:
    r = int(input("Please enter a radius value between 1 ot 100: "))

c = 2*math.pi*r
print(c)
import math

R = float(input())
L=2*math.pi*R
print('L={0}'.format(L))
import math
P=math.pi
R=int(input('とりま入れてみ'))
answer=2*R*P
print(answer)
R = range(1,100)
import math
def Circle(R):
    return(2 * math.pi * R)
R=1
pi=3.14
Circumference=2*R*pi
print(Circumference)
import math

def circle_round(radius):
  return 2 * math.pi * radius

if __name__ == '__main__':
  print(circle_round(4))
import sys
import math
sys.setrecursionlimit(1000000)

def solve(N):
    return N * math.pi

if __name__ == "__main__":
    N = int(input())

    print(solve(N))
import math
R = input()
a = 2*math.pi
print(a)
R = int(input())
ret = R * 3.1415
print(ret)
n = int(input())
pi = 3.1415926
print(n*pi)
R = 1
x = 2 * R * 3.14
print(x)
import math
r = int(input())

print(round(2*r*math.pi),6)
R=int(input())
Z=R*1*3.141592653
print(Z)
R=int(input())
a=R*3.14159265359
print(a)
R = int(input().rstrip())
print(R*3.141592653589793238462643383279502884197169399375105820974944592307816406)
import math
class Solution:
    def maxNumberOfBalloons(R, text: int) -> int:
        return 2 * math.pi * R
a = int(input())
a = 2 * a * 3.14
print("a")
import numpy as np
def solve(r):
    return np.pi * r

r = int(input())
print(solve(r))
print(2 * 3.141592653589793238462643383279 + int(input()))
pi = 3.1
r = int(input())
print(2*r*pi)
R = int(input("R= "))
c = 2*(22/14)*R
print(c)
import math
import sys
N = int(sys.stdin.readline())

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

r = int(input())

print(r * math.pi / 2)
import math

R = float(input())
round(2*math.pi*R, 10)
from math import pi
def cicle(hankei):
    return 2 * hankei * pi
R = 1
x = 2 * R * 3.14
x = 6.28
import math
def circlepond(rad):
  print(radius * math.pi * 2)
radius=int(input('please provide the radius'))
circlepond(radius)
N=int(input())
x=N*3.1415926535897
print(x)
import math
N = input()
M = float(N)*math.pi
print(M)
n,*a=map(int,open(0).read().split())
for i in range(n):print(a.count(i+1))
pi = 3.1415926
n = int(input())
print(n*pi)
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np

def main():
    import math
    R = int(read())
    print(math.pi * (R ** 2))
    return

if __name__ == '__main__':
    main()
import math

R = int(input())
R = R*math.pi

print(R)
R=int(input())
print (R**2*3.14159265358979)
R=1
π=float(input(3.14))
Circle_Pond=2*R*π
print(Circle_Pond)
#!/usr/bin/env python3
t = int(input())
print(3.1415926*t)
R=float(input('とりま入れてみ？'))
P=3.1415
answer=R*R*P
print(int(answer))
import math
rad = int(input())
print(rad*2*math.pi,5)
from math import pi
r = float(input ("Input the radius of the circle : "))
print ("The area of the circle with radius " + str(r) + " is: " + str(pi * r**2))
r=int(input())
Pi=3.1415926535897932384626433
print(r*Pi)
R = float(input())
print(3.141592653589793*R**2)
#!/usr/bin/env python
# -*- coding: utf-8 -*-


def main():
  N, _ = map(int, input().split())
  S = sum(map(int, input().split()))

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


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

for i in range(len(a)):
    n = n - int(a[i])

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

z = n - sum(a)

print(z if z >=0 else -1)
N, M = map(int, input().split())
A = input().split()
if sum(int(i) for i in A) > N:
    print(-1)
else:
    print(N - sum(int(i) for i in A))
n,m,*l=[int(i) for i in open(0).read().split()]
print(max(-1,n-sum(l)))
n, m = map(int, input().split())
a = sum(list(map(int, input().split())))
if n >= a:
    print(n-a)
else:
    print(-1)
n,m=map(int,input().split())
a=list(map(int,input().split()))
if sum(a)>n:
  print(-1)
else:
  print(n-sum(a))
def main():
    n, m = list(map(int, input().split()))
    works = list(map(int, input().split()))

    for w in works:
        n -= w
    print(-1) if n < 0 else print(n)



if __name__ == '__main__':
    main()
N, M = map(int, input().split(' '))
a = list(map(int, input().split(' ')))
sum_a = 0
for i in a:
    sum_a += i
if sum_a > N:
    print(-1)
else:
    print(N - sum_a)
import sys
sys.setrecursionlimit(300000)

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')


N, M = MI()
A = LMI()

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

if sum(List) <= N:
  print(N-sum(List))
else:
  print(-1)
n, m = map(int, input().split())

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

if sum(days) > n:
  print(-1)
else:
  print(n - sum(days))
n, m = map(int,input().split())
li = list(map(int, input().split()))
 
res = n - sum(li)
if res >= 0:
	print(res)
else:
    print(-1)
#!/usr/bin/env python3

from pprint import pprint
import sys

sys.setrecursionlimit(10 ** 6)
input = sys.stdin.buffer.readline

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

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

a = sum(list(map(int, input().split()))) 
ans = n - a

if ans >= 0:
  print(ans)
else:
  print("-1")
n,m=map(int,input().split())
a = list(map(int, input().split()))
print(max(-1, n-sum(a)))
n,m = map(int,input().split())
hwd = list(map(int,input().split()))
s = sum(hwd)
print(n-s) if n >= s else print(-1)
num = list(map(int, input().split()))
a = list(map(int, input().split()))
tmp = num[0]-sum(a)
if tmp<0:
    print(-1)
else:
    print(tmp)
n,m=map(int,input().split())
a=list(map(int,input().split()))
t=sum(a)
if t>n:
  print(-1)
else:
  print(n-t)
N,M = input().split()
day = input().split()
days = []
for d in day:
    days.append(int(d))

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

print(max(-1, n - sum(a)))
N, M = map(int,input().split())
l = list(map(int,input().split()))
su = sum(l)
if N < su:
    print('-1')
else:
    print(N - su)
n,m = map(int,input().split())
a = list(map(int,input().split()))
print('-1' if sum(a)>n else n-sum(a))
def main(N, M, A):
    memo = N - sum(A)
    if memo >= 0:
        return memo
    else:
        return -1

if __name__ == '__main__':
    N, M = list(map(int, input().split()))
    A = list(map(int, input().split()))
    # N = 314
    # M = 15
    # A = list(map(int, "9 26 5 35 8 9 79 3 23 8 46 2 6 43 3".split()))
    # print(N, M, A)
    print(main(N, M, A))
N,M = map(int, input().split())
A = list(map(int, input().split()))

hw = sum(A)

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

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

result = N-sum(A)
if result < 0:
    result = -1
print(result)
n,m = map(int,input().split())

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

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

ans = max(n - sum(a), -1)
print(ans)
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= 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))
N, M = map(int, input().split())

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

days = N-sum(A)
print(days if days >= 0 else -1)
# coding: utf-8
# Your code here!

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

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

if n < sum(a):
    print(-1)
else:
    print(n - sum(a))
def main():
    n,m=map(int,input().split())
    a=list(map(int,input().split()))
    ans=n-sum(a)
    if ans<0:
        ans=-1
    print(ans)
if __name__=="__main__":
    main()
N,M = map(int, input().split())
A = list(map(int, input().split()))

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

for i in A:
    N -= i

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

print(-1) if ans < 0 else print(ans)
N,M = map(int, input().split())
M_list = input().split()

for i in range(M):
  N -= int(M_list[i])
  
if N >= 0:
  print(N)
else:
  print(-1)
n, m = [int(x) for x in input().split(" ")]
times = [int(x) for x in input().split(" ")]

s = sum(times)

if s > n:
    print(-1)
else:
    print(n - s)
def main():
    import sys
    input=sys.stdin.readline
    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()
N,M =map(int,input().split())
A =[int(j) for j in 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()))

sum_ = sum(A)

a = N - sum_

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

if a > n:
    print('-1')
else:
    print(n - a)
N,M=input().split()
N=int(N)
M=int(M)
A=[int(x) for x in input().split()]
i=0
sum_A=0
result=0
if (1<=N<=10**6)and(1<=M<=10**4):
    for i in range(0,M):
        if 1<=A[i]<=10**4:
            sum_A+=A[i]
            i+=1
    result=N-sum_A
    if result<0:
        print(-1)
    else:
        print(result)
n,m=list(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 sum(a) > n:
    print(-1)
else:
    print(n-sum(a))
n,m = map(int,input().split())
l = list(map(int,input().split()))
if sum(l) <= n:
    print(n - sum(l))
else:print(-1)
import math
a = input().split()
b = map(int,input().split())
c = int(a[0])-sum(b)
if (c < 0):
    print("-1")
else:
    print(c)
N, M = map(int, input().split())
S = sum([int(a) for a in input().split()])
print(-1 if S > N else N - S)
#import numpy as np
#import math
#from decimal import *
#from numba import njit

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

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

if sum(A)>N:
  print(-1)
else:
  print(N-sum(A))
#!/usr/bin/env python3
import sys
import math

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

if __name__ == '__main__':
    main()
l = [list(map(int, input().split())) for i in range(2)]
if l[0][0] < sum(l[1]):
  print(-1)
else:
  print(l[0][0] - sum(l[1]))
N, M = map(int,input().split())
A = list(map(int, input().split()))
count = 0
ans = 0

for i in range(M):
    count += A[i]
    
if(N >= count):
    ans = N - count
    print(ans)
else:
    print('-1')
# -*- coding: utf-8 -*-

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

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

sum = 0

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

ans = N - sum

if ans < 0:
    ans = -1

print(ans)
import sys
input = sys.stdin.readline

n,m = map(int, input().split())
a = list(map(int, input().split()))
M = sum(a)
if M > n:
    print(-1)
    quit()
else:
    print(n-M)
n, m = map(int, input().split())
*arr, = map(int, input().split())

print(max(n - sum(arr), -1))