problem_id
stringlengths
6
6
user_id
stringlengths
10
10
time_limit
float64
1k
8k
memory_limit
float64
262k
1.05M
problem_description
stringlengths
48
1.55k
codes
stringlengths
35
98.9k
status
stringlengths
28
1.7k
submission_ids
stringlengths
28
1.41k
memories
stringlengths
13
808
cpu_times
stringlengths
11
610
code_sizes
stringlengths
7
505
p02706
u581603131
2,000
1,048,576
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.
['\nN, M = map(int, input().split())\nA = list(map(int, input().split()))\nsuma = sum(A)\nif N-suma>=0:\n print(N)\nelse:\n print(-1)', '\nN, M = map(int, input().split())\nA = list(map(int, input().split()))\nsuma = sum(A)\nif N-suma>=0:\n print(N-suma)\nelse:\n print(-1)']
['Wrong Answer', 'Accepted']
['s000154522', 's979116727']
[10052.0, 10196.0]
[23.0, 23.0]
[171, 176]
p02706
u582803594
2,000
1,048,576
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.
['N,M=map(int,input().split())\nA=list(map(int,input().split()))\n\nif N>=sum(A):\n print(N-A)\nelse:\n print(-1)', 'N,M=map(int,input().split())\nA=list(map(int,input().split()))\nB=sum(A)\n\nif N>=B:\n print(N-B)\nelse:\n print(-1)']
['Runtime Error', 'Accepted']
['s071138254', 's286258927']
[10124.0, 9980.0]
[30.0, 29.0]
[111, 115]
p02706
u586857375
2,000
1,048,576
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.
["N,M = map(int,input().split())\nlst = list(map(int,input().split()))\nplus = 0\nfor a in range(lst):\n plus += a\nif plus <= N:\n print(N-plus)\nelse:\n print('-1')", "N = int(input())\nM = int(input())\nlst = []\nfor i in range(M):\n lst.append(int(input()))\nplus = 0\nfor a in lst:\n plus += a\nif plus <= N:\n print(N-plus)\nelse:\n print('-1')", "N,M = map(int,input().split())\nlst = list(map(int,input().split()))\nplus = 0\nfor a in lst:\n plus += a\nif plus <= N:\n print(N-plus)\nelse:\n print('-1')"]
['Runtime Error', 'Runtime Error', 'Accepted']
['s557958691', 's763888747', 's717854346']
[10184.0, 9196.0, 9988.0]
[22.0, 21.0, 23.0]
[165, 181, 158]
p02706
u588048170
2,000
1,048,576
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.
['n = int(input())\nm = int(input())\nl1 = []\nfor i in range (m):\n a1 = int(input())\n l1.append(a1)\ns = sum(l1)\nr = n - s\nprint(r)', 'n = int(input())\nm = int(input())\nl1 = []\nfor i in range (m):\n a1 = int(input())\n l1.append(a1)\ns = sum(l1)\nr = n - s\nif r >= 0:\n print(r)\nelse:\n print("-1")', 'n = int(input())\nm = int(input())\nl1 = []\nfor i in range (m):\n ai = int(input())\n l1.append(ai)\ns = sum(l1)\nr = (n - s)\nif r >= 0:\n print(r)\nelse:\n print("-1")', 'n = int(input())\nm = int(input())\nl1 = []\nfor i in range (m):\n a1 = int(input())\n l1.append(a1)\ns = sum(l1)\nresult = n - s\nprint(result)', 'n, m = map(int, input().split())\nai = map(int, input().split())\nli = map(int, list(ai))\ns = sum(li)\nr = (n - s)\nif r >= 0:\n print(r)\nelse:\n print("-1")']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s120844253', 's160537451', 's199543497', 's579448311', 's672160180']
[9164.0, 9128.0, 9192.0, 9124.0, 10152.0]
[20.0, 23.0, 24.0, 22.0, 22.0]
[132, 169, 171, 142, 157]
p02706
u592547545
2,000
1,048,576
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.
["def readinput():\n n,m=map(int,input().split())\n a=list(map(int,input().split()))\n return n,m,a\n\ndef main(n,m,a):\n days=sum(a)\n if days<n:\n return -1\n else:\n return n-days\n\nif __name__=='__main__':\n n,m,a=readinput()\n ans=main(n,m,a)\n print(ans)\n", "def readinput():\n n,m=map(int,input().split())\n a=list(map(int,input().split()))\n return n,m,a\n\ndef main(n,m,a):\n days=sum(a)\n if days>n:\n return -1\n else:\n return n-days\n\nif __name__=='__main__':\n n,m,a=readinput()\n ans=main(n,m,a)\n print(ans)\n"]
['Wrong Answer', 'Accepted']
['s590671471', 's554166248']
[10056.0, 9984.0]
[31.0, 29.0]
[286, 286]
p02706
u596536048
2,000
1,048,576
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.
['day, assignment = map(int, input().split())\nassignment_time = map(int, input().split())\nif sum(assignment_time) > N:\n print(-1)\nelse:\n print(N - sum(assignment_time))', 'day, assignment = map(int, input().split())\nassignment_time = map(int, input().split())\nif sum(assignment_time) > day:\n print(-1)\nelse:\n print(day - sum(assignment_time))', 'day, assignment = map(int, input().split())\nassignment_time = map(int, input().split())\nif sum(assignment_time)<0:\n print(-1)\nelse:\n print(sum(assignment_time))', 'N, M = map(int, input().split())\nA = map(int, input().split())\nprint(max(N - sum(A), -1))']
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s268394218', 's430499225', 's688913194', 's923184329']
[9648.0, 9632.0, 9648.0, 9308.0]
[27.0, 28.0, 29.0, 31.0]
[172, 176, 166, 89]
p02706
u599547273
2,000
1,048,576
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.
['R = int(input())\n\nprint(2*R*3.1415926535897)', 'N, M = map(int, input().split())\nA = list(map(int, input().split()))\n\nx = N-(sum(A))\n\nprint(-1 if x < 0 else x)']
['Runtime Error', 'Accepted']
['s850369960', 's414292589']
[9088.0, 10060.0]
[22.0, 22.0]
[44, 111]
p02706
u604269317
2,000
1,048,576
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.
['timeofholiday=int(input())\nsum=0\nhomework_num=int(input())\nfor i in range(homework_num):\n a=int(input())\n sum+=a\n \nif sum > timeofholiday:\n print("-1")\nelse:\n print(timeofholiday-sum)', 'input_= list(map(int, input().split()))\ntimeofholiday=input_[0]\nsum=0\nhomework_num=input_[1]\nque=list(map(int, input().split()))\nfor i in que:\n sum+=i\n \nif sum > timeofholiday:\n print("-1")\nelse:\n print(timeofholiday-sum)']
['Runtime Error', 'Accepted']
['s707271204', 's614713523']
[9192.0, 9992.0]
[21.0, 22.0]
[188, 225]
p02706
u607074939
2,000
1,048,576
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.
['import math\nR = int(input())\nL = math.pi*2*R\nprint(L)', 'N , M = map(int,input().split())\nA = list(map(int,input().split()))\nS = sum(A)\nprint(max(-1, N-S))']
['Runtime Error', 'Accepted']
['s680345330', 's292088732']
[9168.0, 9888.0]
[21.0, 25.0]
[53, 98]
p02706
u607729897
2,000
1,048,576
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.
["import sys\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\nimport numpy as np\n\ndef main():\n N, M, *A = map(int, read().split())\n ans = sum(A)\n if ans > N:\n ans == -1\n print(ans)\n return\n\nif __name__ == '__main__':\n main()\n\n", "import sys\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\nimport numpy as np\n\ndef main():\n N, M, *A = map(int, read().split())\n ans = sum(A)\n if ans > N:\n ans = -1\n else:\n ans = N - ans\n print(ans)\n return\n\nif __name__ == '__main__':\n main()\n\n"]
['Wrong Answer', 'Accepted']
['s707901354', 's048641107']
[27244.0, 27484.0]
[112.0, 106.0]
[305, 336]
p02706
u610120522
2,000
1,048,576
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.
['N,M = map(int, input().split())\nA = [0] * M\nfor i in M:\n A[i] = int(input())\n N -= A[i]\n\nif N < 0:\n N = -1\n\nprint(N)', 'N,M = map(int, input().split())\nA = list(map(int, input().split()))\nN -= sum(A)\nif N >= 0:\n print(N)\nelse:\n print(-1)']
['Runtime Error', 'Accepted']
['s301252015', 's806941861']
[9264.0, 10000.0]
[23.0, 21.0]
[119, 119]
p02706
u614073932
2,000
1,048,576
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.
["if __name__ == '__main__':\n N, M = [int(x) for x in input().split()]\n arr = [int(x) for x in input().split()]\n res = N - sum(arr)\n if res < 0:\n print(-1)\n else:\n", "if __name__ == '__main__':\n N, M = [int(x) for x in input().split()]\n arr = [int(x) for x in input().split()]\n res = N - sum(arr)\n if res < 0:\n print(-1)\n else:\n print(res)\n"]
['Runtime Error', 'Accepted']
['s534339941', 's720155128']
[9028.0, 10048.0]
[26.0, 26.0]
[183, 202]
p02706
u618251217
2,000
1,048,576
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.
['N,M = map(int, input().split())\nA = list(map(int, input().split()))\n\nans = max(N - sum(A))\nprint(ans)', 'N,M = map(int, input().split())\nA = list(map(int, input().split()))\n\nprint(max(-1, N - sum(A)))']
['Runtime Error', 'Accepted']
['s902359997', 's054179233']
[9852.0, 9796.0]
[28.0, 26.0]
[101, 95]
p02706
u626529075
2,000
1,048,576
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.
['s = input().split(" ")\nN = int(s[0])\nM = s[1]\ns = input().split(" ")\nA = []\nsum = 0\nfor w in s:\n A.append(int(w))\n sum += int(w)\n\nif sum >= N:\n print(N - sum)\nelse:\n print(-1)', 's = input().split(" ")\nN = int(s[0])\nM = s[1]\ns = input().split(" ")\nA = []\nsum = 0\nfor w in s:\n A.append(int(w))\n sum += int(w)\n\nif sum <= N:\n print(N - sum)\nelse:\n print(-1)']
['Wrong Answer', 'Accepted']
['s466720270', 's541310945']
[10056.0, 9880.0]
[25.0, 24.0]
[187, 187]
p02706
u627681436
2,000
1,048,576
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.
['import math\na = input().split()\nb = map(int,input().split())\nif (sum(b) > int(a[0])):\n print("-1")\nelse:\n print(int(a[0]) - sum(b)) ', 'import math\na = input().split()\nb = map(int,input().split())\nc = int(a[0])-sum(b)\nif (c < 0):\n print("-1")\nelse:\n print(c) ']
['Wrong Answer', 'Accepted']
['s465218535', 's007457701']
[9596.0, 9460.0]
[23.0, 22.0]
[138, 129]
p02706
u628597699
2,000
1,048,576
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.
['n,m=map(int,input().split())\na=list(map(int,input().split()))\nfor i in range(m):\n m-=a[i]\nif m>=0:\n print m\nelse:\n print -1', 'n,m=map(int,input().split())\na=list(map(int,input().split()))\nfor i in range(m):\n n-=a[i]\nif n>=0:\n print (n)\nelse:\n print (-1)']
['Runtime Error', 'Accepted']
['s691345439', 's368223588']
[9032.0, 9880.0]
[19.0, 24.0]
[132, 136]
p02706
u628707847
2,000
1,048,576
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.
["n,m = int(input().split())\na = int(input().split())\nif sum(a)>n:\n print('-1')\nelse:\n print(n-sum(a))", "n,m = map(int,input().split())\na = list(map(int,input().split()))\nprint('-1' if sum(a)>n else n-sum(a))"]
['Runtime Error', 'Accepted']
['s857860424', 's876416416']
[9116.0, 10060.0]
[20.0, 22.0]
[102, 103]
p02706
u631579948
2,000
1,048,576
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.
['a,b=map(int,input().split())\nlist_=[]\nfor i in range(b):\n c=int(input())\n list_.append(c)\nd=sum(list_)\nprint(a-d)\n\n \n', "a,b=map(int,input().split())\nc=list(map(int,input().split()))\nd=sum(c)\nans=a-d\nif ans>=0:\n print(ans)\nelse:\n print('-1')\n\n\n \n\n\n\n"]
['Runtime Error', 'Accepted']
['s824475430', 's268271867']
[9224.0, 10052.0]
[22.0, 25.0]
[122, 137]
p02706
u634046173
2,000
1,048,576
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.
["import bisect,collections,copy,heapq,itertools,math,numpy,string\nimport sys\nf = open('input.txt', 'r')\nsys.stdin = f\n\nN, M = map(int, input().split())\nAs = list(map(int, input().split()))\nd = sum(As)\nif N < d:\n print(-1)\nelse:\n print(N-d)\n", "import bisect,collections,copy,heapq,itertools,math,numpy,string\nimport sys\nf = open('input.txt', 'r')\nsys.stdin = f\n\nN, M = map(int, input().split())\nAs = list(map(int, input().split()))\nd = sum(As)\nif N < d:\n print(-1)\nelse:\n print(N-d) \n", 'N, M = map(int, input().split())\nAs = list(map(int, input().split()))\nd = sum(As)\nif N < d:\n print(-1)\nelse:\n print(N-d)\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s128223495', 's341761631', 's355862288']
[27192.0, 27192.0, 9868.0]
[105.0, 110.0, 22.0]
[245, 246, 127]
p02706
u640603056
2,000
1,048,576
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.
['import sys\n\ndef ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))\ndef ISI(): return map(int, sys.stdin.readline().rstrip().split())\n\nn, m = ISI()\nl=ILI()\nif n-sum8(l)<:print(-1)\nelse:print(n-sum(l))', 'import sys\ndef ISI(): return map(int, sys.stdin.readline().rstrip().split())\n\nn, m = ISI()\nl=ILI()\nprint(n-sum(l))', 'import sys\n\ndef ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))\ndef ISI(): return map(int, sys.stdin.readline().rstrip().split())\n\nn, m = ISI()\nl=ILI()\nif n-sum(l)<0:print(-1)\nelse:print(n-sum(l))']
['Runtime Error', 'Runtime Error', 'Accepted']
['s242592929', 's459243919', 's809410968']
[8956.0, 9192.0, 10136.0]
[22.0, 19.0, 23.0]
[216, 114, 216]
p02706
u643679148
2,000
1,048,576
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.
['# -*- coding: utf-8 -*-\n\nn, m = map(int, input().split())\na = list(map(int, input().split()))\n\nans = n - sum(a)\n\nif ans < 0:\n return -1\nelse:\n return ans\n', '# -*- coding: utf-8 -*-\n\nn, m = map(int, input().split())\na = list(map(int, input().split()))\n\nans = n - sum(a)\n\nif ans < 0:\n print(-1)\nelse:\n print(ans)\n']
['Runtime Error', 'Accepted']
['s589640867', 's124003335']
[9096.0, 10044.0]
[24.0, 30.0]
[160, 160]
p02706
u646203242
2,000
1,048,576
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.
['N, M=map(int,input.split())\na=list(map(int,input.split()))\nif N-sum(a)>=0:\n print(N-sum(a))\nelse:\n print(-1)\n ', 'N, M=map(int,input.split())\na=[map(int,input.split())]\nif N-sum(a)>=0:\n print(N-sum(a))\nelse:\n print(-1)\n ', 'N, M=map(int,input().split())\na=list(map(int,input().split()))\nif N-sum(a)>=0:\n print(N-sum(a))\nelse:\n print(-1)\n ']
['Runtime Error', 'Runtime Error', 'Accepted']
['s435567739', 's642678751', 's999245620']
[8880.0, 9020.0, 9936.0]
[21.0, 20.0, 20.0]
[113, 109, 117]
p02706
u646560152
2,000
1,048,576
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.
['from sys import stdin\nN,M = stdin.readline().rstrip().split()\na_list = stdin.readline().rstrip().split()\nN,M = int(N),int(M)\nfor a in a_list:\n N-=int(a)\nif(N>0):\n print(N)\nprint(-1)\n', "from sys import stdin\nN,M = stdin.readline().rstrip().split()\na_list = stdin.readline().rstrip().split()\nN,M = int(N),int(M)\nfor a in a_list:\n N-=int(a)\nif(N>=0):\n print(N)\nprint('-1')", "from sys import stdin\nN,M = stdin.readline().rstrip().split()\na_list = stdin.readline().rstrip().split()\nN,M = int(N),int(M)\nfor a in a_list:\n N-=int(a)\nif(N>=0):\n print(N)\nelse:\n\tprint('-1')"]
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s630432482', 's668615923', 's958881326']
[9544.0, 9492.0, 9544.0]
[24.0, 24.0, 22.0]
[184, 186, 193]
p02706
u646934622
2,000
1,048,576
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.
['N = int(input())\nM = int(input())\n\na = [input().split() for i in range(M)]\n\nif sum(a) > N:\n print(-1)\n \nelse:\n print(N - sum(a))', 'N, M = input().split()\n \na = list(map(int,input().split()))\n \nif sum(a) > int(N):\n print(-1)\n \nelse:\n print(int(N) - sum(a))']
['Runtime Error', 'Accepted']
['s738228179', 's815442161']
[9180.0, 10048.0]
[20.0, 22.0]
[131, 127]
p02706
u647679586
2,000
1,048,576
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.
['# summer vacations, number of assignments\nN, M = list(map(int, input().split()))\n# each entry in A represents number of days to do the assignment\nA = list(map(int, input().split()))\n\nnumber_of_days_required = sum(A)\nmaximum_hangout_days = N - number_of_days_required\nif maximum_hangout_days >= 0:\n \tprint(maximum_hangout_days)\n else:\n print(-1)', '# summer vacations, number of assignments\nN, M = list(map(int, input().split()))\n# each entry in A represents number of days to do the assignment\nA = list(map(int, input().split()))\n\nnumber_of_days_required = sum(A)\nmaximum_hangout_days = N - number_of_days_required\nif maximum_hangout_days >= 0:\n print(maximum_hangout_days)\n else:\n print(-1)', '# summer vacations, number of assignments\nN, M = list(map(int, input().split()))\n# each entry in A represents number of days to do the assignment\nA = list(map(int, input().split()))\n\nnumber_of_days_required = sum(A)\nmaximum_hangout_days = N - number_of_days_required\nif maximum_hangout_days >= 0:\n print(maximum_hangout_days)\nelse:\n print(-1)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s628897521', 's856618692', 's590450739']
[8940.0, 9000.0, 10032.0]
[25.0, 25.0, 24.0]
[349, 348, 348]
p02706
u647796955
2,000
1,048,576
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.
['import sys\nN,M = list(map(int, sys.stdin.readline().rstrip().split())) \nA = list(map(int, sys.stdin.readline().rstrip().split())) \n\ns = 0\nfor n in range(M):\n s += A[n]\n \ns -= N\nif s < 0:\n print(-1)\nelse:\n print(s)\n', 'N,M = list(map(int, sys.stdin.readline().rstrip().split())) \nA = list(map(int, sys.stdin.readline().rstrip().split())) \n\ns = 0\nfor n in range(M):\n s += A[n]\n \ns -= N\nif s < 0:\n print(-1)\nelse:\n print(s)', 'import sys\nN,M = list(map(int, sys.stdin.readline().rstrip().split())) \nA = list(map(int, sys.stdin.readline().rstrip().split())) \n\ns = 0\nfor n in range(M):\n s += A[n]\n \ns = N - s\nif s < 0:\n print(-1)\nelse:\n print(s)\n']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s398533339', 's461039338', 's600073088']
[10040.0, 9116.0, 10036.0]
[25.0, 24.0, 25.0]
[218, 206, 221]
p02706
u648881683
2,000
1,048,576
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.
['from b import resolve\nimport sys\nfrom io import StringIO\nimport unittest\n\nclass TestClass(unittest.TestCase):\n def assertIO(self, input, output):\n stdout, stdin = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(input)\n resolve()\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, stdin\n self.assertEqual(out, output)\n def test_入力例_1(self):\n input = """41 2\n5 6"""\n output = """30"""\n self.assertIO(input, output)\n def test_入力例_2(self):\n input = """10 2\n5 6"""\n output = """-1"""\n self.assertIO(input, output)\n def test_入力例_3(self):\n input = """11 2\n5 6"""\n output = """0"""\n self.assertIO(input, output)\n def test_入力例_4(self):\n input = """314 15\n9 26 5 35 8 9 79 3 23 8 46 2 6 43 3"""\n output = """9"""\n self.assertIO(input, output)\n def test_Sample_Input_1(self):\n input = """41 2\n5 6"""\n output = """30"""\n self.assertIO(input, output)\n def test_Sample_Input_2(self):\n input = """10 2\n5 6"""\n output = """-1"""\n self.assertIO(input, output)\n def test_Sample_Input_3(self):\n input = """11 2\n5 6"""\n output = """0"""\n self.assertIO(input, output)\n def test_Sample_Input_4(self):\n input = """314 15\n9 26 5 35 8 9 79 3 23 8 46 2 6 43 3"""\n output = """9"""\n self.assertIO(input, output)\n\nif __name__ == "__main__":\n unittest.main()', "import sys\ninput = lambda: sys.stdin.readline().rstrip() \n\ndef resolve():\n N, M = map(int, input().split())\n A = list(map(int, input().split()))\n\n s = sum(A)\n if s<=N:\n print(N-s)\n else:\n print(-1)\n\nif __name__ == '__main__':\n resolve()\n"]
['Runtime Error', 'Accepted']
['s835065553', 's678642705']
[9268.0, 9988.0]
[22.0, 24.0]
[1552, 269]
p02706
u650265349
2,000
1,048,576
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.
['import numpy as np\nN, M = map(int, input().split())\nA_list = np.array(list(map(int, input().split())))\n\ntotal = np.sum(A_list)\nfree_day = max(N - M, -1)\nprint(free_day)', 'import numpy as np\nN, M = map(int, input().split())\nA_list = np.array(list(map(int, input().split())))\n\ntotal = np.sum(A_list)\nfree_day = max(N - total, -1)\nprint(free_day)']
['Wrong Answer', 'Accepted']
['s811416342', 's951550247']
[27556.0, 27872.0]
[105.0, 108.0]
[168, 172]
p02706
u651058930
2,000
1,048,576
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.
['n, m = map(int, input().split())\nA = sum(list(map(int, input(.split()))))\nif A <= n:\n print(n-A)\nelse:\n print(-1)', 'n, m = map(int, input().split())\nA = sum(list(map(int, input().split())))\nif A <= n:\n print(n-A)\nelse:\n print(-1)']
['Runtime Error', 'Accepted']
['s515940337', 's128874778']
[9020.0, 10000.0]
[22.0, 22.0]
[119, 119]
p02706
u652081898
2,000
1,048,576
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.
['n, m = map(int, input().split())\na = 0\nfor _ in range(m):\n a += int(input())\nif a > n: print(-1)\nelse: print(n-a)', 'n, m = map(int, input().split())\na = list(map(int, input().split()))\nprint(max(n-sum(a), -1))\n']
['Runtime Error', 'Accepted']
['s539916165', 's767175577']
[9228.0, 10060.0]
[23.0, 24.0]
[114, 94]
p02706
u655048024
2,000
1,048,576
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.
['n,m = map(int,input().split())\na = list(map(int,input.split()))\nA = 0\nfor i in range(m):\n A += a[i]\nif(A<=N):\n print(N-A)\nelse:\n print(-1)\n', 'n,m = map(int,input().split())\na = list(map(int,input()))\nA = 0\nfor i in range(m):\n A += a[i]\nif(A<=N):\n print(N-A)\nelse:\n print(-1)', 'n,m = map(int,input().split())\na = list(map(int,input().split()))\nA = 0\nfor i in range(m):\n A += a[i]\nk = n-A\nif(k>=0):\n print(k)\nelse:\n print(-1)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s763146904', 's886140891', 's722389216']
[9168.0, 9284.0, 10084.0]
[23.0, 24.0, 24.0]
[142, 135, 149]
p02706
u656919695
2,000
1,048,576
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.
["a,b=map(int,input().split())\n\nc=[i for i in input().split()]\n\nprint(a-sum(c) if a>=sum(c) else '-1')", "a,b=map(int,input().split())\n \nc=[int(i) for i in input().split()]\nd=sum(c)\nprint(a-sum(c) if a>=sum(c) else '-1')"]
['Runtime Error', 'Accepted']
['s319683064', 's394740934']
[9684.0, 9876.0]
[24.0, 25.0]
[100, 114]
p02706
u671036469
2,000
1,048,576
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.
['n, m = map(int, input().split())\n\na = list(map(int,input().split()))\n\nif n > sum(a):\n print(-1)\nelse:\n print(n - sum(a))\n', 'n, m = map(int, input().split())\n\na = list(map(int,input().split()))\n\nif n < sum(a):\n print(-1)\nelse:\n print(n - sum(a))\n']
['Wrong Answer', 'Accepted']
['s773768150', 's359725216']
[9892.0, 10124.0]
[25.0, 24.0]
[127, 127]
p02706
u681390786
2,000
1,048,576
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.
['n,m=map(int,input().split())\na=[int(b) for b in input().split()]\ndef func(n,a):\n if n< sum(a):return "-1"\n else: \n return n-sum(a)\n', 'n,m=map(int,input().split())\na=[b for b in int(input().split())]\ndef func(n,a):\n if n< sum(a):return "-1"\n else: \n return n-sum(a)\nprint(func(n,a))', 'n,m=map(int,input().split())\na=[int(b) for b in input()]\ndef func(n,a):\n if n< sum(a):return "-1"\n else: \n return n-sum(a)\nprint(func(n,a))', 'n,m=map(int,input().split())\na=[int(b) for b in input().split()]\ndef func(n,a):\n if n< sum(a):return "-1"\n else: \n return n-sum(a)\nprint(func(n,a))']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s698912851', 's702207733', 's916151018', 's640760840']
[9920.0, 9564.0, 9136.0, 10084.0]
[21.0, 22.0, 21.0, 22.0]
[144, 160, 152, 160]
p02706
u686318881
2,000
1,048,576
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.
["N=int(input())\nM=int(input())\narray = list(map(int, input().strip().split()))\nif(N>=sum(array)):\n print(N-sum(array))\nelse:\n print('-1')", "N, M = map(int, input().split())\na = list(map(int, input().split()))\nif(N>=sum(a)):\n print(N-sum(a))\nelse:\n print('-1')"]
['Runtime Error', 'Accepted']
['s015378128', 's020228983']
[9184.0, 9912.0]
[22.0, 21.0]
[142, 125]
p02706
u688281605
2,000
1,048,576
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.
['n,m = map(int,input().split())\na = [0 for i in range(m)]\n\nres = n - sum(a)\nif(res <= 0):\n res = -1\nprint(res)', 'n,m = map(int,input().split())\na = list(map(int, input().strip().split()))\n\nres = n - sum(a)\nif(res < 0):\n res = -1\nprint(res)\n\n']
['Wrong Answer', 'Accepted']
['s126198005', 's036367471']
[9176.0, 10000.0]
[22.0, 23.0]
[110, 129]
p02706
u690037900
2,000
1,048,576
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.
['n,m= map(int,input().split())\nL=list(map(int,input().split()))\nprint(n-sum(L) if n-sum(L)>=0 else -1)', '\nn=list(map(int,input().split()))\nL=list(map(int,input().split()))\nprint(n[0]-sum(L) if n[0]-sum(L)>=0 else "-1")']
['Runtime Error', 'Accepted']
['s425289621', 's280436524']
[9016.0, 10120.0]
[25.0, 24.0]
[103, 113]
p02706
u694402282
2,000
1,048,576
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.
['n, m = map(int, input().split())\nli = input().split()\nb = 0\nfor a in li:\n b = b + a\nif n >= b:\n print(n-b)\nelse:\n print("-1")', 'n, m = map(int, input().split())\nli = input().split()\nb = 0\nfor a in li:\n b = b + int(a)\nif n >= b:\n print(n-b)\nelse:\n print("-1")']
['Runtime Error', 'Accepted']
['s676562521', 's102200319']
[9452.0, 9580.0]
[22.0, 23.0]
[134, 139]
p02706
u695644361
2,000
1,048,576
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.
['n=int(input().split()[1])\nf=n-sum(map(int,input().split()))\nprint(-1 if f<0 else f)', 'n,m=map(int,input().split())\nf=n-sum(map(int,input().split()))\nprint(-1 if f<0 else f)']
['Wrong Answer', 'Accepted']
['s081191495', 's963331502']
[9516.0, 9520.0]
[22.0, 24.0]
[83, 86]
p02706
u697422981
2,000
1,048,576
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.
['N,m = input().split()\nM = int(m)\nL1 = list(map(int,input().split()))\nans=-1\nif sum(L1)<=N:\n ans = N - sum(L1)\nprint(ans)', 'N,m = input().split()\nM = int(m)\nL1 = list(map(int,input().split()))\nans=-1\nif sum(L1)<=N:\n ans = N - sum(L1)\nprint(ans)', 'n,m = input().split()\nN = int(n)\nL1 = list(map(int,input().split()))\nans=-1\nif sum(L1)<=N:\n ans = N-sum(L1)\nprint(ans)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s996400045', 's997793634', 's884178730']
[9880.0, 10124.0, 9876.0]
[21.0, 20.0, 22.0]
[123, 123, 121]
p02706
u702018889
2,000
1,048,576
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.
['n,m=map(int,input().split())\na=sum(list(map(int,input().split())))\nif n-a<=0:\n print(n-a)\nelse:\n print(-1)', 'n,m=map(int,input().split())\na=list(map(int,input().split()))\nprint(n-sum(a) if n-sum(a)<0 else -1)', 'n=int(input())\nm=int(input())\na=list(map(int,input().split()))\nprint(n-sum(a))', 'n,m=map(int,input().split())\na=sum(list(map(int,input().split())))\nif n-a>=0:\n print(n-a)\nelse:\n print(-1)\n']
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s028135953', 's702179291', 's907379624', 's714568859']
[9988.0, 9876.0, 9112.0, 9984.0]
[23.0, 24.0, 25.0, 23.0]
[112, 99, 78, 113]
p02706
u702582845
2,000
1,048,576
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.
['N=input()\nN=int(N)\nM=input()\nM=int(M)\n\nsum=0\nfor num in range(M):\n\ta=input()\n\ta=int(a)\n\tsum=sum+a\n\t\nnokori=N-sum\t\nif nokori>=0:\n\tprint(nokori)\n\t\nelse:\n\tprint(-1)', 'N,M=input().split()\nN=int(N)\nM=int(M)\n\nsum=0\na=list(map(int,input().split()))\nfor num in range(M):\n\tsum=sum+a[num]\n\t\nnokori=N-sum\t\nif nokori>=0:\n\tprint(nokori)\n\t\nelse:\n\tprint(-1)']
['Runtime Error', 'Accepted']
['s671771421', 's528906748']
[9196.0, 10188.0]
[22.0, 24.0]
[161, 178]
p02706
u717162155
2,000
1,048,576
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.
['N, M = map(int,input().split()) \nA = [list(map(int,input().split())) for i in range(M)]\n\nw = sum(A)\n\nr = N-w\n\nif r<0:\n print(-1)\nelse:\n print(r)\n', 'N, M = map(int,input().split()) \nP = [list(map(int,input().split())) for i in range(M)]\n\nw = sum(A)\n\nr = N-w\n\nif r<0:\n print(-1)\nelse:\n print(r)', 'N, M = map(int, input().split())\nA = [input().split() for i in range(M)]\n\nw = sum(A)\n\nr = N-w\n\nif r<0:\n print(-1)\nelse:\n print(r)', 'N, M = map(int, input().split())\nA = [list(map(int,input().split())) for i in range(M)]\n\nw = sum(A)\n\nr = N-w\n\nif r<0:\n print(-1)\nelse:\n print(r)\n', 'N, M = map(int,input().split()) \nA = list(map(int,input().split()))\n\nw = sum(A)\n\nr = N-w\n\nif r<0:\n print(-1)\nelse:\n print(r)\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s598927010', 's628108138', 's705039904', 's840529070', 's666587261']
[9848.0, 10060.0, 9664.0, 10188.0, 10052.0]
[21.0, 23.0, 23.0, 20.0, 23.0]
[147, 146, 131, 147, 127]
p02706
u717839182
2,000
1,048,576
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.
['def actual(n, m, a_list):\n a_sum = sum(a_list)\n\n if n >= a_sum:\n return n - a_sum\n\n return -1\n\nN, M = map(int, input().split())\na_list = map(int, input().split())\n\nprint(actual(n, m, a_list))', 'def actual(n, m, a_list):\n a_sum = sum(a_list)\n\n if n >= a_sum:\n return n - a_sum\n\n return -1\n\nn, m = map(int, input().split())\na_list = map(int, input().split())\n\nprint(actual(n, m, a_list))\n']
['Runtime Error', 'Accepted']
['s393957871', 's835646515']
[9604.0, 9328.0]
[23.0, 22.0]
[207, 208]
p02706
u718270795
2,000
1,048,576
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.
['N, M = map(int,input().split()))\nl = list(map(int,input().split()))\nsu = l.sum()\nif N < su:\n print(-1)\nelse:\n print(N - su)', "N, M = map(int,input().split())\nl = list(map(int,input().split()))\nsu = sum(l) + 1\nif N < su:\n print('-1')\nelse:\n print(N - su) ", 'N, M = map(int,input().split())\nl = list(map(int,input().split()))\nsu = sum(l) + 1\nif N < su:\n print(-1)\nelse:\n print(N - su)', "N, M = map(int,input().split())\nl = list(map(int,input().split()))\nsu = sum(l)\nif N < su:\n print('-1')\nelse:\n print(N - su)"]
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s286553064', 's470629495', 's523126220', 's282159402']
[9008.0, 10048.0, 10040.0, 9840.0]
[23.0, 22.0, 23.0, 21.0]
[129, 134, 131, 129]
p02706
u719270674
2,000
1,048,576
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.
['N = int(input())\nM = int(input())\nlist =[]\nhomework = 0\n\nfor A in range(0, M):\n list.append(int(input()))\n homework = homework + list[A]\n\nplay = N - homework\n\nif play < 0:\n print(-1)\nelse:\n print(play)', 'N, M = map(int, input().split())\na = list(map(int, input().split()))\nhomework = 0\n\nfor i in range(M):\n homework += a[i]\n\nplay = N - homework\n\nif play < 0:\n print(-1)\nelse:\n print(play)']
['Runtime Error', 'Accepted']
['s018039318', 's287600604']
[9136.0, 9852.0]
[25.0, 28.0]
[213, 193]
p02706
u720124072
2,000
1,048,576
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.
['n, m = map(int, input().split())\na = list(map(int, input().split()))\n\nif sum(a) > n:\n print(-1)\nelse:\n print(sum(a) - n)', 'n, m = map(int, input().split())\na = list(map(int, input().split()))\n\nif sum(a) > n:\n print(-1)\nelse:\n print(n - sum(a))']
['Wrong Answer', 'Accepted']
['s103377808', 's812681048']
[9888.0, 10096.0]
[31.0, 29.0]
[122, 122]
p02706
u720314082
2,000
1,048,576
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.
['N,M = map(int,input().split())\na = [int(input()) for i in range(M)]\nfor i in range(M):\n N -= a[i]\nprint(N if N>0 else -1)', 'N,M = map(int,input().split())\na = [int(input()) for i in range(M)]\nfor i in range(M):\n N = N - a[i]\nprint(N if N>0 else -1)\n', "N,M = map(int,input().split())\na = list(map(int, input().split()))\nfor i in range(M+1):\n N -= a[i]\nprint(N if N>0 else '-1')\n", "N,M = map(int,input().split())\na = list(map(int, input().split()))\nfor i in range(M):\n N -= a[i]\nprint(N if N>=0 else '-1')\n"]
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s404571355', 's478102327', 's494385719', 's862197137']
[9212.0, 9164.0, 10096.0, 9816.0]
[22.0, 23.0, 24.0, 23.0]
[122, 126, 126, 125]
p02706
u721121954
2,000
1,048,576
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.
['k=input()\n\nlist_a=k.split()\n\nn=list_a[0]\n\nint(n)\n\nm=list_a[1]\n\nint(m)\n\nt=input()\n\nlist_b=t.split()\n\nh=len(list_b)\n\nlist_s=[int(s) for s in list_b]\n\nif m==h and sum(list_s)>=n:\n print(sum(list_s)-n)\nelif m==h and sum(list_s)<n:\n print("-1")', 'k=input()\n\nlist_a=k.split()\n\nn=list_a[0]\n\nint(n)\n\nm=list_a[1]\n\nint(m)\n\nt=input()\n\nlist_b=t.split()\n\nh=len(list_b)\n\nint(h)\n\nlist_s=[int(s) for s in list_b]\n\nif m==h and sum(list_s) <= n:\n print(n-sum(list_s))\nelif m==h and sum(list_s) > n:\n print("-1")', 'k=input()\n\nlist_a=k.split()\n\nn=list_a[0]\n\nm=list_a[1]\n\nt=input()\n\nlist_b=t.split()\n\nh=len(list_b)\n\nlist_s=[int(s) for s in list_b]\n\nif int(m)==int(h) and sum(list_s) <= int(n):\n print(int(n)-sum(list_s))\nelif int(m)==int(h) and sum(list_s) > int(n):\n print("-1")\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s687362602', 's845897264', 's951285056']
[9864.0, 9704.0, 9836.0]
[27.0, 26.0, 28.0]
[241, 253, 265]
p02706
u731322489
2,000
1,048,576
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.
['n, m = map(int, input().split())\nworks = list(map(int, input().split()))\n\nprint(works)\nplays = n - sum(works)\nprint(plays if plays >= 0 else -1)', 'n, m = map(int, input().split())\nworks = list(map(int, input().split()))\n\nplays = n - sum(works)\nprint(plays if plays >= 0 else -1)']
['Wrong Answer', 'Accepted']
['s366602225', 's444886846']
[10112.0, 9868.0]
[23.0, 23.0]
[144, 131]
p02706
u735975757
2,000
1,048,576
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.
['n,m = map(int,input().split())\nA = list(map(int.input().split()))\n\nfor i in range(m):\n n -= A(i)\n \nif n < 0:\n print(-1)\nelse:\n print(n)', 'n,m = map(int, input().split())\nA = list(map(int,input().split()))\n\nhw_days = 0\n\nfor i in len(A):\n hw_days += A(i)\n\nvacation = n - hw_days\n\nif vacation < 0:\n print(-1)\nelse:\n print(vacation)', 'n,m = map(int,input().split())\nA = list(map(int,input().split()))\n \nfor i in range(m):\n n -= A(i)\n \nif n < 0:\n print(-1)\nelse:\n print(n)', 'n,m = map(int,input().split())\nA = list(map(int,input().split()))\n \nfor i in range(m):\n n -= A[i]\n \nif n < 0:\n print(-1)\nelse:\n print(n)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s192333350', 's500065063', 's641078628', 's490299828']
[9192.0, 10036.0, 10000.0, 9872.0]
[22.0, 24.0, 21.0, 25.0]
[139, 193, 140, 140]
p02706
u736729525
2,000
1,048,576
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.
['N, M\nA = sum([int(x) for x in input().split()])\nif N - M < 0:\n print(-1)\nelse:\n print(N-M)', 'N, M = map(int, input().split())\nA = sum([int(x) for x in input().split()])\nif N - M < 0:\n print(-1)\nelse:\n print(N-M)', 'N, M = map(int, input().split())\nA = sum([int(x) for x in input().split()])\nif N - A < 0:\n print(-1)\nelse:\n print(N-A)']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s071659132', 's420796250', 's223403898']
[9084.0, 9940.0, 9852.0]
[20.0, 24.0, 20.0]
[92, 120, 120]
p02706
u744695362
2,000
1,048,576
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.
["N,M =map(int,input().split())\na =list( map(int,input().split()) )\nif sum(a)-N >=0:\n print(sum(a)-N)\nelse :\n print('-1') ", 'N,M =map(int,input().split())\na =list( map(int,input().split()) )\nif N-sum(a) >=0:\n print(N-sum(a))\nelse :\n print(-1) ']
['Wrong Answer', 'Accepted']
['s522419574', 's630752963']
[9876.0, 9884.0]
[22.0, 22.0]
[127, 127]
p02706
u746206084
2,000
1,048,576
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.
['n,m = map(int,input().split())\nli=list(map(int,input().split()))\ng=n-sum(li)\nif g>=0:\n print g\nelse:\n print -1', 'n,m = map(int,input().split())\nli=list(map(int,input().split()))\ng=n-sum(li)\nif g>=0:\n return g\nelse:\n return -1', 'n,m = map(int,input().split())\nli=list(map(int,input().split()))\ng=n-sum(li)\nif g>=0:\n print(g)\nelse:\n print(-1)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s012970537', 's528525941', 's026582466']
[9028.0, 9100.0, 9876.0]
[23.0, 20.0, 23.0]
[116, 114, 118]
p02706
u748311048
2,000
1,048,576
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.
['import math\n# i=int(input())\n#n,m=map(int, input().split())\nr = int(input())\nprint(r*2*math.pi)\n', 'n, m = map(int, input().split())\na = list(map(int, input().split()))\nprint(-1 if n-sum(a) < 0 else n-sum(a))\n']
['Runtime Error', 'Accepted']
['s088800045', 's879868089']
[9168.0, 10040.0]
[25.0, 25.0]
[96, 109]
p02706
u749359783
2,000
1,048,576
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.
['N, M = map(int, input().split())\nA = [int(i) for i in input().split()]\n\nif sum(A)>N:\n print(-1)\nelse:\n print(sum(A)-N)', 'N, M = map(int, input().split())\nA = [int(i) for i in input().split()]\n\nif sum(A)>N:\n print(-1)\nelse:\n print(N-sum(A))']
['Wrong Answer', 'Accepted']
['s801234944', 's475798927']
[9980.0, 9876.0]
[26.0, 24.0]
[124, 124]
p02706
u749614185
2,000
1,048,576
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.
['N, M = map(int, input().split())\nA = list(map(int, input().split()))\nsum = 0\n\nfor i in A:\n sum += i\n\nif sum > N:\n print(-1)\nelse:\n print(n - sum) ', 'n,m = map(int,input().split())\nA = list(map(int, input().split()))\n \na = sum(A)\n \nans = n-a\nif ans < 0:\n ans = -1\n \nprint(ans)\n']
['Runtime Error', 'Accepted']
['s167108609', 's878841677']
[9848.0, 9992.0]
[28.0, 33.0]
[158, 130]
p02706
u751539777
2,000
1,048,576
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.
["N, M = [map(int, input(.split()))]\n\nworks = [map(int, input().split())]\n\nans = N\n\nfor i in range(M):\n ans -= works[i]\n\nif ans < 0:\n print('-1')\nelse:\n print(ans)", 'N, M = map(int, input().split())\nworks = list(map(int,input().split()))\n\nif N >= sum(works):\n print(N - sum(works))\nelse:\n print("-1")']
['Runtime Error', 'Accepted']
['s153986274', 's082681744']
[9012.0, 9888.0]
[23.0, 22.0]
[170, 136]
p02706
u752395175
2,000
1,048,576
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.
['from sys import stdin\n \nr = int(stdin.readline().rstrip())\nprint(r*2*3.1415)', 'from sys import stdin\n\nholiday_count, task_count = stdin.readline().rstrip().split()\nholiday_count = int(holiday_count)\ntasks_days = sum([int(x) for x in stdin.readline().rstrip().split()])\n\nremain = holiday_count - tasks_days\nif remain < 0:\n print(-1)\nelse:\n print(remain)']
['Runtime Error', 'Accepted']
['s758944863', 's604386378']
[9144.0, 10016.0]
[23.0, 24.0]
[76, 275]
p02706
u758973277
2,000
1,048,576
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.
["N,M = map(int,input().split())\nA = sorted(map(int, input().split()))\nans = sum(A)-N\nif = sum(A)-N >= 0:\n print(ans)\nelse:\n print('-1')\n ", "N,M = map(int,input().split())\nA = sorted(map(int, input().split()))\nans = N-sum(A)\nif = N-sum(A) >= 0:\n print(ans)\nelse:\n print('-1')", "N,M = map(int,input().split())\nA = sorted(map(int, input().split()))\nans = N-sum(A)\nif N-sum(A) >= 0:\n print(ans)\nelse:\n print('-1')"]
['Runtime Error', 'Runtime Error', 'Accepted']
['s472707876', 's712752117', 's155850894']
[9024.0, 8856.0, 9996.0]
[23.0, 22.0, 21.0]
[139, 136, 134]
p02706
u759884285
2,000
1,048,576
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.
['N,M=map(int,input().split())\nlists0=list(map(int,input().split()))\nlists1=lists0[0:M-1]\nSUM=sum(lists1)\nX=N-SUM\nif X>=0:print(X)\nelse:print("-1")', 'N,M=map(int,input().split())\nlists0=list(map(int,input().split()))\nlists1=lists0[0:M-1]\nSUM=sum(lists0)\nX=N-SUM\nif X>=0:print(X)\nelse:print(-1)']
['Wrong Answer', 'Accepted']
['s606555941', 's861600960']
[9884.0, 10056.0]
[25.0, 23.0]
[145, 143]
p02706
u763550415
2,000
1,048,576
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.
['N, M = map(int, input().split())\nA = list(map(int,input(),split()))\na = sum(A)\n\nif N >= a:\n print(int(N-a))\nif N < a:\n print(-1)', 'N, M = map(int, input().split())\nA = list(map(int,input().split()))\na = sum(A)\n \nif N >= a:\n print(int(N-a))\nelse:\n print(-1)']
['Runtime Error', 'Accepted']
['s958797441', 's566915497']
[9088.0, 9928.0]
[26.0, 30.0]
[130, 127]
p02706
u768256617
2,000
1,048,576
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.
['n,m=map(int,input().split())\n\na=list(map(int,input().split()))\ns=sum(a)\n\nif n-a> 0:\n print(n-a)\n \nelse:\n print(-1)', 'n,m=map(int,input().split())\n \na=list(map(int,input().split()))\ns=int(sum(a))\n \nif (n-s)>= 0:\n print(n-s)\n \nelse:\n print(-1)']
['Runtime Error', 'Accepted']
['s032092547', 's194807770']
[10004.0, 10072.0]
[27.0, 21.0]
[117, 127]
p02706
u771156630
2,000
1,048,576
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.
['n,m = map(int,input().split())\n\nc=list(map(int,input().split()))\n\ntotal = 0\n\nfor i in range m:\n total += c[i]\n\nif((n-total) >= 0):\n print(n-total)\nelse:\n print(-1)', 'n,m = map(int,input().split( ))\n\nc=list(map(int,input().split( )))\n\n\ntotal = 0\n\nfor i in range(m):\n total += c[i]\n\nif((n-total) >= 0):\n print(n-total)\nelse:\n print(-1)']
['Runtime Error', 'Accepted']
['s924839195', 's078437404']
[9028.0, 10068.0]
[24.0, 24.0]
[172, 176]
p02706
u772029934
2,000
1,048,576
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.
['N,M = map(int,input().split())\nA = list(map(int,input().split()))\ncounter = 0\nfor i in range(M):\n counter += A[i]\n \nif N - conter>=0:\n print(N-counter)\nelse:\n priont("-1")', 'N,M = map(int,input().split())\nA = list(map(int,input().split()))\ncounter = 0\nfor i in range(M):\n counter += A[i]\n \nif N - conter>=0:\n print(N-counter)\nelse:\n print("-1")', 'N,M = map(int,input().split())\nA = list(map(int,input().split()))\ncounter = 0\nfor i in range(M):\n counter += A[i]\n \nif N - conter>=0:\n print(N-counter)\nelse:\n print(-1)', 'N,M = map(int,input().split())\nA = list(map(int,input()))\ncounter = 0\n\nfor i in range(M):\n counter += A[i]\n \nprint(N-counter)\n', 'N,M = map(int,input().split())\nA = list(map(int,input().split()))\ncounter = 0\nfor i in range(M):\n counter += A[i]\n \nif N - counter>=0:\n print(N-counter)\nelse:\n print(-1)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s005153577', 's058981910', 's520762100', 's981543755', 's588957503']
[10080.0, 10052.0, 9916.0, 9120.0, 10172.0]
[22.0, 23.0, 22.0, 24.0, 22.0]
[183, 182, 180, 132, 181]
p02706
u779728630
2,000
1,048,576
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.
['N, M = map(int, input().split())\nA = list(map(int, input().split())\n\ns = sum(A)\n\nprint( max(N - A, -1) )', 'N, M = map(int, input().split())\nA = list(map(int, input().split()))\n \ns = sum(A)\n \nprint( max(N - A, -1) )', 'N, M = map(int, input().split())\nA = list(map(int, input().split()))\n \ns = sum(A)\n \nprint( max(N - s, -1) )']
['Runtime Error', 'Runtime Error', 'Accepted']
['s001566228', 's110359101', 's541855157']
[8960.0, 10220.0, 10012.0]
[20.0, 23.0, 23.0]
[104, 107, 107]
p02706
u779830746
2,000
1,048,576
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.
['summer_vacation, amount_of_homework = map(int, input().split())\na = map(int, input().split())\nhomework_list = list[a]\n\ntotal_days = 0\n\nfor i in homework_list:\n total_days += i\n\nif summer_vacation >= total_days:\n print(summer_vacation - total_days)\nelse:\n print(-1)\n', 'summer_vacation, amount_of_homework = map(int, input().split())\na = map(int, input().split())\nhomework_list = list(a)\n\ntotal_days = 0\n\nfor i in homework_list:\n total_days += i\n\nif summer_vacation >= total_days:\n print(summer_vacation - total_days)\nelse:\n print(-1)\n']
['Runtime Error', 'Accepted']
['s080879362', 's092660157']
[9596.0, 9848.0]
[24.0, 32.0]
[274, 274]
p02706
u791110052
2,000
1,048,576
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.
['from operator import add\nimport numpy as np\nimport functools\n\n\nn = int(input())\nm = int(input())\nlist_homework = input().split(" ")\nlist_homework = [int(list_homework[i]) for i in range(len(list_homework))] \n\nrest_day = n - functools.reduce(add, list_homework)\n\nif rest_day >= 0:\n print(rest_day)\nelse:\n print("-1")', 'import numpy as np\n\nn = int(input())\nm = int(input())\nlist_homework = input().split(" ")\nlist_homework = np.array([int(list_homework[i]) for i in range(len(list_homework))]) \n\nrest_day = n - list_homework.sum()\n\nif rest_day >= 0:\n print(rest_day)\nelse:\n print("-1")', 'from operator import add\nimport numpy as np\nimport functools\n\n\nn = int(input())\nm = int(input())\nlist_homework = input().split(" ")\nlist_homework = [int(list_homework[i]) for i in range(len(list_homework))] \n\nrest_day = n - functools.reduce(add, list_homework)\n\nif rest_day >= 0:\n print(rest_day)\nelse:\n print("-1")', 'from operator import add\nimport numpy as np\nimport functools\n\n\nn = int(input())\nm = int(input())\nlist_homework = input().split(" ")\nlist_homework = [int(list_homework[i]) for i in range(len(list_homework))] \n\nrest_day = n - functools.reduce(add, list_homework)\n\nif rest_day >= 0:\n print(rest_day)\nelse:\n print("-1")', 'from operator import add\nimport numpy as np\nimport functools\n\n\nn = int(input())\nm = int(input())\nlist_homework = input().split(" ")\nlist_homework = [int(list_homework[i]) for i in range(len(list_homework))] \n\nrest_day = n - functools.reduce(add, list_homework)\n\nif rest_day >= 0:\n print(rest_day)\nelse:\n print("-1")', 'from operator import add\nimport numpy as np\nimport functools\n\n\nn = int(input())\nm = int(input())\nlist_homework = input().split(" ")\nlist_homework = [int(list_homework[i]) for i in range(len(list_homework))] \n\nrest_day = n - functools.reduce(add, list_homework)\n\nif rest_day >= 0:\n print(rest_day)\nelse:\n print("-1")', 'from operator import add\nimport numpy as np\nimport functools\n\n\nn = int(input())\nm = int(input())\nlist_homework = input().split(" ")\nlist_homework = [int(list_homework[i]) for i in range(len(list_homework))] \n\nrest_day = n - functools.reduce(add, list_homework)\n\nif rest_day >= 0:\n print(rest_day)\nelse:\n print("-1")', 'from operator import add\nimport numpy as np\nimport functools\n\n\nn = int(input())\nm = int(input())\nlist_homework = input().split(" ")\nlist_homework = [int(list_homework[i]) for i in range(len(list_homework))] \n\nrest_day = n - functools.reduce(add, list_homework)\n\nif rest_day >= 0:\n print(rest_day)\nelse:\n print("-1")', 'from operator import add\nimport functools\n\n\nn = int(input())\nm = int(input())\nlist_homework = input().split(" ")\nlist_homework = [int(list_homework[i]) for i in range(len(list_homework))] \n\nrest_day = n - functools.reduce(add, list_homework)\n\nif rest_day >= 0:\n print(rest_day)\nelse:\n print("-1")', 'from operator import add\nimport functools\n\n\nn = input().split(" ")\n\nlist_homework = input().split(" ")\nlist_homework = [int(list_homework[i]) for i in range(len(list_homework))] \n\nrest_day = int(n[0]) - functools.reduce(add, list_homework)\n\nif rest_day >= 0:\n print(rest_day)\nelse:\n print("-1")']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s001431341', 's002344033', 's017016846', 's361469075', 's489354676', 's580382246', 's597640383', 's636637289', 's765012500', 's899440147']
[27144.0, 27136.0, 27148.0, 26792.0, 27112.0, 27152.0, 27172.0, 27080.0, 9564.0, 10436.0]
[105.0, 108.0, 108.0, 115.0, 105.0, 111.0, 97.0, 98.0, 27.0, 28.0]
[322, 272, 322, 322, 322, 322, 322, 322, 303, 301]
p02706
u799428010
2,000
1,048,576
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.
["N,M=list(map(int, input().split()))\nA=list(map(int, input().split()))\nans=sum(A)\nif N<ans:\n print('-1')\nelse:\n print(M-ans)", "N,M=map(int,input().split())\nA=list(map(int,input().split()))\nsumA=sum(A)\nif N<sumA:\n print(N-sumA)\nelse:\n print('-1')", "N,M=map(int,input().split())\nA=list(map(int,input().split()))\nif N<sum(A):\n print('-1')\nelse:\n print(N-sum(A))"]
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s366640374', 's839364515', 's619026384']
[9864.0, 10188.0, 10064.0]
[26.0, 28.0, 33.0]
[129, 124, 116]
p02706
u802662134
2,000
1,048,576
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.
['N,M = map(int,input().split())\n\nlist = [map(int,input().split())]\n\nif count(list) > N:\n print(-1)\nelse:\n print(N-count(list))', 'N,M = map(int,input().split())\nA = [map(int,input().split())]\nprint(max(-1,N-sum(A)))', 'N,M = map(int,input().split())\nA = list(map(int,input().split()))\nprint(max(-1,N-sum(A)))']
['Runtime Error', 'Runtime Error', 'Accepted']
['s438772298', 's553948457', 's300368294']
[9500.0, 9512.0, 10160.0]
[23.0, 25.0, 22.0]
[127, 85, 89]
p02706
u806392288
2,000
1,048,576
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.
['N,M = map(int,input().split())\nans = 0\nfor i in range(M):\n A = int(input())\n N -= M\nif N >= 0:\n print(N)\nelse:\n print("-1")', 'N,M = map(int,input().split())\nA = list(map(int,input().split()))\nans = N - sum(A)\nif ans >= 0:\n print(ans)\nelse:\n print("-1")']
['Runtime Error', 'Accepted']
['s493498568', 's332782861']
[9056.0, 10200.0]
[21.0, 21.0]
[127, 128]
p02706
u810066979
2,000
1,048,576
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.
['n,m=map(int,input().split())\na=list(map(int,input().split()))\n\nif(sum(a)>m):\n\tprint(-1)\nelse:\n\tval=n-sum(a)\n\tprint(val)', 'n,m=map(int,input().split())\na=list(map(int,input().split()))\n\nif(sum(a)<n):\n\tprint(-1)\nelse:\n\tval=n-sum(a)\n\tprint(val)', 'n,m=map(int,input().split())\na=list(map(int,input().split()))\n\nif(sum(a)>n):\n\tprint(-1)\nelse:\n\tval=n-sum(a)\n\tprint(val)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s137449767', 's805871675', 's467592965']
[10048.0, 9968.0, 9880.0]
[22.0, 20.0, 23.0]
[119, 119, 119]
p02706
u815304751
2,000
1,048,576
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.
['n,m = map(int,input().split())\na_ = list(map(int,input().split()))\n\nsum = sum(s_)\nres = n - sum\n\nif(res < 0):\n print(-1)\nelse:\n print(res)\n', 'n,m = map(int,input().split())\na_ = list(map(int,input().split()))\n\nsum = sum(a_)\nres = n - sum\n\nif(res < 0):\n print(-1)\nelse:\n print(res)\n']
['Runtime Error', 'Accepted']
['s373022327', 's843934475']
[9980.0, 9984.0]
[25.0, 21.0]
[145, 145]
p02706
u819911285
2,000
1,048,576
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.
['x,y = map(int, input().spilit())\narray = list(map(int, input().spilit()))\nsu = sum(array)\na = x - su\nif a > -1:\n\tprint(a)\nelse:\n\tprint(-1)', 'x,y = map(int, input().spilit())\narray = list(map(int, input().spilit()))\nsu = sum(array)\na = x - su\nif a > -1:\n print(a)\nelse:\n print(-1)', 'x, y = map(int, input().spilit())\narray = list(map(int, input().spilit()))\nsu = sum(array)\na = x - su\nif a > -1:\n print(a)\nelse:\n print(-1)', 'x, y = map(int, input().split())\narray = list(map(int, input().split()))\nsu = sum(array)\na = x - su\nif a > -1:\n print(a)\nelse:\n print(-1)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s114146265', 's680449730', 's711712623', 's839091099']
[8976.0, 9108.0, 9120.0, 9892.0]
[24.0, 21.0, 25.0, 22.0]
[138, 140, 145, 143]
p02706
u821265215
2,000
1,048,576
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.
['n, m = list(map(int, input().split()))\na = list(map(int, input().split()))\ntotal = 0\nfor i in a:\n total += a\nif n < total:\n print(-1)\nelse:\n print(n - total)\n', 'n, m = list(map(int, input().split()))\na = list(map(int, input().split()))\ntotal = 0\nfor i in a:\n total += i\nif n < total:\n print(-1)\nelse:\n print(n - total)']
['Runtime Error', 'Accepted']
['s747806981', 's385324392']
[10056.0, 9884.0]
[23.0, 25.0]
[161, 160]
p02706
u824981877
2,000
1,048,576
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.
['N, M = map(int, input().split())\nA = map(int, input().split())\n\nans1 = sum(A)\nans2 = N - ans1\n\nif sns2 < 0:\n print(-1)\nelse:\n print(ans2)', '\nN, M = map(int, input().split())\nA = map(int, input().split())\n\nans = N - sum(A)\n\nif ans < 0:\n print(-1)\nelse:\n print(ans)']
['Runtime Error', 'Accepted']
['s779188302', 's333637780']
[9532.0, 9596.0]
[22.0, 28.0]
[143, 129]
p02706
u830162518
2,000
1,048,576
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.
['N,M=map(int,input().split())\nL=list(map(int,input().split()))\nfor i in range(M):\n X=X+L[i]\nif N-X<0:\n print(-1)\nelse:\n print(N-X)', ',M=map(int,input().split())\nL=list(map(int,input().split()))\nfor i in range(M):\n X=X+L[i]\nif N-X<0:\n print(-1)\nelse:\n print(N-X)', 'N,M=map(int,input().split())\nL=list(map(int,input().split()))\nX=sum(L)\nif N-X<0:\n print(-1)\nelse:\n print(N-X)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s233793302', 's541218244', 's991539860']
[10048.0, 8968.0, 9984.0]
[25.0, 19.0, 21.0]
[132, 131, 111]
p02706
u831752983
2,000
1,048,576
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.
['n,m=map(int,input().split())\nfor num\tin input().split():\n n-=num\nprint(n if n>=0 else -1)', 'n,m=map(int,input().split())\nfor num\tin input().split():\n n-=int(num)\nprint(n if n>=0 else -1)\n']
['Runtime Error', 'Accepted']
['s007451555', 's383575486']
[9520.0, 9572.0]
[24.0, 21.0]
[90, 96]
p02706
u840964147
2,000
1,048,576
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.
['a = input()\nb = input()\n\ndays,home = [int(i) for i in a.split(" ")]\ncost = [int(n) for n in b.split(" ")]\nprint(days,home)\nprint(cost)\n\nvaliddate = int(days) - sum(cost)\nif validdate >= 0:\n print(validdate)\nelse:\n print(-1)', 'a = input()\nb = input()\n\ndays,home = [int(i) for i in a.split(" ")]\ncost = [int(n) for n in b.split(" ")]\n#print(days,home)\n#print(cost)\n\nvaliddate = int(days) - sum(cost)\nif validdate >= 0:\n print(validdate)\nelse:\n print(-1)']
['Wrong Answer', 'Accepted']
['s153915616', 's852293445']
[9920.0, 9904.0]
[22.0, 25.0]
[229, 231]
p02706
u843318346
2,000
1,048,576
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.
['n,m = map(int,input())\nai = list(map(int,input().split()))\nsumday = sum(ai)\nif n-sumday<0:\n print(-1)\nelse:\n print(n-sumday)', 'n,m = map(int,input().split())\nai = list(map(int,input().split()))\nsumday = sum(ai)\nif n-sumday<0:\n print(-1)\nelse:\n print(n-sumday)\n']
['Runtime Error', 'Accepted']
['s086600690', 's629328723']
[9044.0, 10036.0]
[21.0, 21.0]
[126, 135]
p02706
u845148770
2,000
1,048,576
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.
['N,Q = map(int, input().split())\nl = list(map(int,input().split()))\n\nans = 0\nfor i in range(0,M):\n ans = ans + l[i]\n \nif(ans > N):\n print("-1")\nelse:\n print(N-ans) ', 'N,Q = map(int, input().split())\nl = list(map(int,input().split()))\n \nans = 0\nfor i in range(0,Q):\n ans = ans + l[i]\n \nif(ans > N):\n print("-1")\nelse:\n print(N-ans) ']
['Runtime Error', 'Accepted']
['s359539024', 's303420433']
[9888.0, 9880.0]
[21.0, 26.0]
[168, 169]
p02706
u845573105
2,000
1,048,576
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.
['N = map(int, input().split())[0]\nA = map(int, input().split())\nsum = 0\nfor i in A:\n sum += A\nif sum > N:\n print(-1)\nelse:\n print(N-sum)', 'N = list(map(int, input().split()))[0]\nA = list(map(int, input().split()))\n\nsum = 0\nfor i in A:\n sum = sum + i\nif sum > N:\n print(-1)\nelse:\n print(N-sum)']
['Runtime Error', 'Accepted']
['s421507204', 's445054567']
[9056.0, 9884.0]
[23.0, 23.0]
[138, 156]
p02706
u845650912
2,000
1,048,576
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.
['N,M = map(int,input().split())\nA = [int(x) for x in input().split()]\n\nif N - sum(A) >= 0:\n print(N - A.sum())\nelse:\n print(-1)\n ', 'N,M = map(int,input().split())\nA = [0] * M\nA = [int(x) for x in input().split()]\n\nif N - sum(A) >= 0:\n print(N - A.sum())\nelse:\n print(-1)\n ', 'N,M = map(int,input().split())\nA = [int(x) * M for x in input().split()]\n\nif N - sum(A) >= 0:\n print(N - A.sum())\nelse:\n print(-1)\n ', 'N,M = map(int,input().split())\nA = list(map(int, input().split())) \n\nif N - sum(A) >= 0:\n print(N - sum(A))\nelse:\n print(-1)\n ']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s443051319', 's673552967', 's910222607', 's822571860']
[10060.0, 10204.0, 9884.0, 9988.0]
[20.0, 21.0, 22.0, 23.0]
[137, 149, 141, 135]
p02706
u846385882
2,000
1,048,576
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.
['import numpy as np\n \nN,M=map(int, input().split()) \nA=list(map(int, input().split())\n \nsumA=np.sum(A)\nremain=N-sumA\n \nif remain>=0:\n\tprint(remain)\nelse:\n\tprint(-1)', 'import numpy as np \nN,M=map(int, input().split()) \nA=list(map(int, input().split()) \nsuma=np.sum(A)\nremain=N-suma \n\nif remain>=0:\n print(remain)\nelse:\n print(-1)', 'import numpy as np\n\nN,M=map(int, input().split()) \nA=list(map(int, input().split())\n\nsuma=np.sum(A)\nremain=N-suma\n \nif remain>=0:\n print(remain)\nelse:\n print(-1)', "import numpy as np\n\nN,M=map(int, input().split()) \nA=list(map(int, input().split())\n\nsuma=np.sum(A)\nremain=N-suma\n \nif remain>=0:\n print(remain)\nelse:\n print('-1')\n", 'import numpy as np\n\nN,M=map(int, input().split())\nA=list(map(int, input().split()))\n\nsuma=np.sum(A)\nremain=N-suma\n\nif remain>=0:\n\tprint(remain)\nelse:\n\tprint(-1)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s097314142', 's105326711', 's122366806', 's406468249', 's824737058']
[9020.0, 9016.0, 9016.0, 9016.0, 27780.0]
[24.0, 23.0, 22.0, 21.0, 105.0]
[170, 174, 180, 183, 160]
p02706
u848462327
2,000
1,048,576
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.
['import sys\n\nN, M = map(int, input().split())\n\nA = []\nfor l in sys.stdin:\n A.append(int(l))\n \nneed_day = sum(A)\n \nif N < need_day:\n print(-1)\nelse:\n print(N-need_day)', 'N, M = map(int, input().split())\nA = list(map(int,input().split()))\n\nneed_day = sum(A)\n\nif N < need_day:\n print(-1)\nelse:\n print(N-need_day)\n']
['Runtime Error', 'Accepted']
['s261218507', 's446434484']
[9172.0, 9888.0]
[24.0, 22.0]
[180, 147]
p02706
u849229491
2,000
1,048,576
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.
['n,m = map(int,input().split())\nA = list(int(input()).split())\ntmp = n-sum(A)\n\nif tmp >= 0:\n print(tmp)\nelse:\n print(-1)\n ', 'n,m = map(int,input().split())\nA = list(map(int,input().split()))\ntmp = n-sum(A)\n\nif tmp >= 0:\n print(tmp)\nelse:\n print(-1)']
['Runtime Error', 'Accepted']
['s777052750', 's750968377']
[9180.0, 9876.0]
[23.0, 23.0]
[124, 125]
p02706
u852552252
2,000
1,048,576
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.
['a=map(int,input().split(" "))\nAi=map(int,input().split(" "))\nn=a[0]\ndays=0\nfor i in range(a[1]):\n days+=Ai[i]\nif days>n:\n print(-1)\nelse:\n print(n-days)', 'a=map(int,input().split(" "))\nAi=map(int,input().split(" "))\nn=a[0]\ndays=0\nfor A in Ai:\n days+=A\nif days>n:\n print(-1)\nelse:\n print(n-days)', 'n,m=map(int,input().split(" "))\nAi=list(map(int,input().split(" ")))\ndays=0\nfor a in Ai:\n days+=a\nif days>n:\n print(-1)\nelse:\n print(n-days)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s350907722', 's699289822', 's918875811']
[9332.0, 9412.0, 10056.0]
[22.0, 22.0, 21.0]
[161, 148, 149]
p02706
u854780853
2,000
1,048,576
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.
["N,M = map(int,input().split())\nplan = list(map(int,input().split()))\nsum = N\nfor i in range(M):\n sum = sum - plan[i]\n\nif sum >= 0:\n print(plan)\n\nelse:\n print('-1')", "N,M = map(int,input().split())\nplan = list(map(int,input().split()))\nsum = N\nfor i in range(M):\n sum = sum - plan[i]\n\nif 0 <= sum <= N:\n print(sum)\n\nelse:\n print('-1')"]
['Wrong Answer', 'Accepted']
['s998668004', 's030998468']
[9884.0, 10200.0]
[23.0, 22.0]
[166, 170]
p02706
u857428111
2,000
1,048,576
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.
['import sys\nsys.setrecursionlimit(10000000)\n\n#const\ndxdy=((1,0),(0,1))\n#my functions here!\ndef pin(type=int):\n return map(type,input().rstrip().split())\nfrom math import gcd\n\n#your code here!\ndef resolve():\n N,M=pin()\n A=(pin())\n t=(N)-sum(A)\n #print(t)\n ans=t if t>-1 else -1\n print(ans)\n\nimport sys\nfrom io import StringIO\nimport unittest\n\n\nclass TestClass(unittest.TestCase):\n def assertIO(self, input, output):\n stdout, stdin = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(input)\n resolve()\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, stdin\n self.assertEqual(out, output)\n\n def test_入力例_1(self):\n input = """41 2\n5 6"""\n output = """30"""\n self.assertIO(input, output)\n\n def test_入力例_2(self):\n input = """10 2\n5 6"""\n output = """-1"""\n self.assertIO(input, output)\n\n def test_入力例_3(self):\n input = """11 2\n5 6"""\n output = """0"""\n self.assertIO(input, output)\n\n def test_入力例_4(self):\n input = """314 15\n9 26 5 35 8 9 79 3 23 8 46 2 6 43 3"""\n output = """9"""\n self.assertIO(input, output)\n\n\nif __name__ == "__main__":\n #unittest.main()\n\n"""\n I wrote my code above!\n"""\n resolve()#and submit 2 atcoder!\n\n', 'import sys\nsys.setrecursionlimit(10000000)\n\n#const\ndxdy=((1,0),(0,1))\n#my functions here!\ndef pin(type=int):\n return map(type,input().rstrip().split())\nfrom math import gcd\n\n#your code here!\ndef resolve():\n N,M=pin()\n A=(pin())\n t=(N)-sum(A)\n #print(t)\n ans=t if t>-1 else -1\n print(ans)\n\nimport sys\nfrom io import StringIO\nimport unittest\n\n\nclass TestClass(unittest.TestCase):\n def assertIO(self, input, output):\n stdout, stdin = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(input)\n resolve()\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, stdin\n self.assertEqual(out, output)\n\n def test_入力例_1(self):\n input = """41 2\n5 6"""\n output = """30"""\n self.assertIO(input, output)\n\n def test_入力例_2(self):\n input = """10 2\n5 6"""\n output = """-1"""\n self.assertIO(input, output)\n\n def test_入力例_3(self):\n input = """11 2\n5 6"""\n output = """0"""\n self.assertIO(input, output)\n\n def test_入力例_4(self):\n input = """314 15\n9 26 5 35 8 9 79 3 23 8 46 2 6 43 3"""\n output = """9"""\n self.assertIO(input, output)\n\n\nif __name__ == "__main__":\n #unittest.main()\n\n\n resolve()\n\n']
['Runtime Error', 'Accepted']
['s325305028', 's753764373']
[9076.0, 16884.0]
[21.0, 61.0]
[1373, 1317]
p02706
u863370423
2,000
1,048,576
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.
['N , M = input().split(" ")\ntm = 0\nfor i in range(int(M)):\n i = input()\n tm = tm + int(i)\nprint(int(N)-tm)', 'a,b=map(int,input().split())\nc=list(map(int,input().split()))\nd=sum(c)\nprint(a-d if a-d>=0 else -1)']
['Runtime Error', 'Accepted']
['s695831925', 's176513404']
[8984.0, 9604.0]
[22.0, 28.0]
[111, 99]
p02706
u863964720
2,000
1,048,576
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.
['N,M = map(int, input().split())\nA = [list(map(int,input().split()))]\nprint(A)\nSUM = sum(A[0])\nif SUM>N:\n print(-1)\nelse:\n print(N-SUM)', 'N,M = map(int, input().split())\nA = [0]*M\nfor i in range(M):\n A[i] = int(input())\nSUM = sum(A)\nif SUM>N:\n print(-1)\nelse:\n print(N-SUM)', 'N,M = map(int, input().split())\nA = [list(map(int,input().split()))]\nprint(A)\nSUM = sum(A[0])\nif SUM>N:\n print(-1)\nelse:\n print(N-SUM)', 'N,M = map(int, input().split())\nA = [list(map(int,input().split()))]\nSUM = sum(A[0])\nif SUM>N:\n print(-1)\nelse:\n print(N-SUM)']
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s002180675', 's044525971', 's627134850', 's682161552']
[10012.0, 9224.0, 10048.0, 10012.0]
[25.0, 23.0, 25.0, 23.0]
[140, 144, 140, 131]
p02706
u871841829
2,000
1,048,576
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.
['N, M = map(int, input().split())\nA = list(map(int, input().split())\n \nt = sum(A)\nif N < t:\n print(-1)\nelse:\n print(N-A)', 'r = int(input())\nimport math\nprint(2*r * math.pi)', 'N, M = map(int, input().split())\nA = list(map(int, input().split()))\n \nt = sum(A)\nif N < t:\n print(-1)\n exit(0)\nelse:\n print(N-A)', 'N, M = map(int, input().split())\nA = list(map(int, input().split()))\n \nt = sum(A)\nif N < t:\n print(-1)\n exit(0)\nelse:\n print(N-t)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s320215275', 's366232489', 's892677776', 's342070839']
[8848.0, 9132.0, 9832.0, 9856.0]
[26.0, 24.0, 29.0, 31.0]
[129, 49, 140, 140]
p02706
u883675704
2,000
1,048,576
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.
['N, M = input().split()\n\nN = int(N)\nM = int(M)\n\na = input().split()\n\na = int(a)\n\n\nif sam(a) < N:\n print(N - sam(a))\n\nif sam(a) > N:\n print(-1)\n ', 'N, M = input().split()\n\nN = int(N)\nM = int(M)\n\na = list(map(int, input().split()))\n\n\nif sum(a) < N:\n print(N-sum(a))\n\nif sum(a) == N:\n print(0)\n\nif sum(a) > N:\n print(-1)']
['Runtime Error', 'Accepted']
['s689909842', 's846394726']
[9668.0, 9984.0]
[22.0, 22.0]
[152, 179]
p02706
u887222798
2,000
1,048,576
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.
['M, N= input().split()\nA1, Am = input().split()\nif 1 <= int(N) < 10**6 and 1 <= int(M) < 10**4 and 1 <= int(A1) < 10**4 :\n if((int(A1) + int(Am)) <= int(M)):\n print((int(A1)+int(Am))-int(M))\n elif (int(A1) + int(Am)) == int(M):\n print(0)\n elif (int(A1)+int(Am)) > int(M):\n print(-1)', 'M, N = map(int ,input().split())\nx = [int(x) for x in input().split()]\nif (sum(x)) > M:\n print(-1)\nelif(sum(x) == M):\n print(0)\nelif(sum(x)<M):\n print(M-sum(x))']
['Runtime Error', 'Accepted']
['s206547317', 's056521739']
[9512.0, 10060.0]
[27.0, 23.0]
[311, 169]
p02706
u901144784
2,000
1,048,576
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.
['n,m=(int(i) for i in input().split())\nl=[int(i) for i in input().split()]\nif(sum(l)>=n):\n\tprint(n-sum(l))\nelse:\n\tprint(-1', 'n,m=(int(i) for i in input().split())\nl=[int(i) for i in input().split()]\nif(sum(l)<=n):\n\tprint(n-sum(l))\nelse:\n\tprint(-1)']
['Runtime Error', 'Accepted']
['s624571205', 's386228582']
[9040.0, 10052.0]
[25.0, 22.0]
[121, 122]
p02706
u901598613
2,000
1,048,576
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.
['N,M=map(int,input().split)\nlis=list(map(int, input().split()))\ns=0\nfor i in lis:\n s+=i\nif N-s<0:\n print("-1")\nelse:\n print(N-s)', 'N,M=map(int,input().split())\nlis=list(map(int, input().split()))\ns=0\nfor i in lis:\n s+=i\nif N-s<0:\n print("-1")\nelse:\n print(N-s)']
['Runtime Error', 'Accepted']
['s090548106', 's801309874']
[9108.0, 10120.0]
[20.0, 22.0]
[136, 138]
p02706
u904331908
2,000
1,048,576
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.
['n,m = map(int,input()>split())\nhomework = list(map(int,input().split()))\n\nif n >= sum(homework):\n print(n-sum(homework))\n\nelse:\n print(-1)', 'n,m = map(int,input().split())\nhomework = list(map(int,input().split()))\n\nif n >= sum(homework):\n print(n-sum(homework))\n\nelse:\n print(-1)\n']
['Runtime Error', 'Accepted']
['s070482650', 's275368978']
[9012.0, 9884.0]
[23.0, 30.0]
[140, 141]
p02706
u904995051
2,000
1,048,576
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.
['#ABC163B\nn,m = map(int,input().split())\na = list(map(int,inout().split()))\nprint(-1 if sum(a) >= n else n-sum(a))', '#ABC163B\nn,m = map(int,input().split())\na = list(map(int,input().split()))\nprint(-1 if sum(a) > n else n-sum(a))']
['Runtime Error', 'Accepted']
['s038671152', 's883474332']
[9024.0, 9820.0]
[20.0, 35.0]
[113, 112]
p02706
u907223098
2,000
1,048,576
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.
['n,m=(int(i) for i in input().split())\na=[int(i) for i in input().split()]\ns=sum(a)\nif n-a>=0:\n print(n-a)\nelse:\n print(-1)', 'n,m=(int(i) for i in input().split())\na=[int(i) for i in input().split()]\ns=sum(a)\nif n-s>=0:\n print(n-s)\nelse:\n print(-1)\n']
['Runtime Error', 'Accepted']
['s389998950', 's186338000']
[9860.0, 10060.0]
[23.0, 21.0]
[124, 125]
p02706
u910426639
2,000
1,048,576
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.
['N, M = map(int, input().split())\n\nA = list(map(int, input().split()))\n\ns = sum(A)\n\nif s > N:\n print(-1)\nelse:\n print(N - s)\nprint(-1)', 'N, M = map(int, input().split())\n\nA = list(map(int, input().split()))\n\ns = sum(A)\n\nif s > N:\n print(-1)\nelse:\n print(N - s)']
['Wrong Answer', 'Accepted']
['s130083704', 's759336238']
[9892.0, 10072.0]
[22.0, 21.0]
[139, 129]