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
u320456643
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.
['D, n = map(int.input().split())\n\nfor i in range(n):\n A[i] = input()\n i += 1\n D_sum += A[i]\n x = D - D_sum\nprint()', 'N, M = map(int,input().split())\n\nA = list(map(int, input().split()))\nA_sum = 0\nfor i in range(0, n):\n A_sum += A[i]\n \nx = N - A_sum\nif x < N:\n print("-1")\nelse:\n print(x)', 'N, M = map(int,input().split())\n\nA = list(map(int, input().split()))\nA_sum = 0\nfor i in range(0, n):\n A_sum += A[i]\n \nx = N - A_sum\nprint(x)', 'N, M = map(int,input().split())\n\nA = list(map(int, input().split()))\nA_sum = 0\nfor i in range(0, M):\n A_sum += A[i]\n \nx = N - A_sum\nif x < 0:\n print("-1")\nelse:\n print(x)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s383372629', 's653606785', 's789840913', 's243814594']
[9052.0, 10108.0, 10012.0, 10028.0]
[22.0, 24.0, 27.0, 25.0]
[125, 239, 203, 239]
p02706
u325270534
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 math import floor\n\nX, val, a = eval(input()), 100, 1\n\nwhile True :\n val += floor(val * 0.01)\n if val >= X:\n break\n a += 1\nprint(a)', 'N, M = map(int, input().split())\nA = list(map(int, input().split()))\ndaytofinish = sum(A)\nif N-daytofinish < 0:\n print(-1)\nelse:\n print(N-daytofinish)']
['Runtime Error', 'Accepted']
['s470083946', 's835781425']
[9048.0, 10056.0]
[22.0, 22.0]
[151, 156]
p02706
u329753128
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 = input.split()\ntotal = 0\nfor i in range(A):\n total = total+A[i]\n\nif total <= N:\n print (N - total)\nelse:\n print ("-1")\n', 'N = int(input())\nM = int(input())\ntotal = 0\n\nfor i in range(M):\n A = int(input())\n total = total+A\n\nif total <= N:\n print (N - total)\nelse:\n print (-1)\n', 'N = int(input())\nM = int(input())\ntotal = 0\n\nfor i in range(M):\n \tA = int(input())\n total = total + A\n \nif total <= N:\n print (N - total)\nelse:\n \tprint "-1"', 'N = int(input())\nM = int(input())\ntotal = 0\n \nfor i in range(M):\n A = int(input())\n total = total+A\n \nif total <= N:\n print (N - total)\nelse:\n print ("-1")', 'import math\n\nn, m = map(int, input().split())\na = list(map(int, input().split()))\n\nif (n-sum(a)) < 0:\n print(-1)\nelse:\n print(n-sum(a))\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s085087338', 's278196023', 's753005030', 's962058577', 's567376124']
[9096.0, 9176.0, 9044.0, 9180.0, 10040.0]
[22.0, 20.0, 22.0, 23.0, 22.0]
[159, 164, 167, 167, 142]
p02706
u331330867
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())\nA=list(range(M+1))\nplay_day=N-sum(A)\nif play_day>0:\n print(play_day)\nelse:\n print(-1)', 'print(sum([int(r) for r in input().split(" ")])-sum([int(r) for r in input().split(" ")]))', 'a,b=input().split()\nc,d=input().split()\na=int(a)\nb=int(b)\nc=int(c)\nd=int(d)\nplay_day=a-(b+c)\nif play_day>=0:\n print(play_day)\nelse:\n print(-1)', 'N=int(input())\nM=int(input())\nA=list(range(M+1))\nplay_day=N-sum(A)\nif play_day>0:\n print(play_day)\nelse:\n print("-1")', '([int(r) for r in input().split(" ")])-sum([int(r) for r in input().split(" ")])', 'a,b=map(int,input().split())\nC=list(map(int,input().split()))\nplay_day=a-sum(C)\nif play_day>=0:\n print(play_day)\nelse:\n print("-1")']
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s447704850', 's518019169', 's627103422', 's633876424', 's879625667', 's503788526']
[9196.0, 10100.0, 9520.0, 9132.0, 9876.0, 10088.0]
[20.0, 22.0, 20.0, 23.0, 20.0, 25.0]
[121, 90, 148, 123, 80, 137]
p02706
u331997680
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 = [input().split() for i in range(M)]\n \nif(sum(A) == N):\n print('0')\nelif(sum(A) > N):\n print(N - sum(A))\nelse:\n print('-1')", "N, M = map(int, input().split())\nA = A = map(int, input().split())\n \nif(sum(A) == N):\n print('0')\nelif(sum(A) > N):\n print(N - sum(A))\nelse:\n print('-1')", "N, M = map(int, input().split())\nA = [int(input().split()) for i in range(M)]\n \nif(sum(A) == N):\n print('0')\nelif(sum(A) > N):\n print(N - sum(A))\nelse:\n print('-1')", "N, M = map(int, input().split())\nA = map(int, input().split())\n \nif(sum(A) == N):\n print('0')\nelif(sum(A) < N):\n print(N - sum(A))\nelse:\n print('-1')", "N, M = map(int, input().split())\nA = [input() for i in range(M)]\n \nif(sum(A) == N):\n print('0')\nelif(sum(A) > N):\n print(N - sum(A))\nelse:\n print('-1')", "N, M = map(int, input().split())\nA = [input() for i in range(M)]\n\nif(sum(A) = N):\n print('0')\nelif(sum(A) > N):\n print(N - sum(A))\nelse:\n print('-1')", "N, M = map(int, input().split())\nA = map(int, input().split())\n \nif(sum(A) == N):\n print('0')\nelif(sum(A) > N):\n print(sum(A) - N)\nelse:\n print('-1')\n", "N, M = map(int, input().split())\nA = map(int, input().split())\n \nif(sum(A) == N):\n print('0')\nelif(sum(A) > N):\n print(N - sum(A))\nelse:\n print('-1')", "N, M = map(int, input().split())\nA = input().split()\nB = [ ]\nfor i in range(M):\n B.append(int(A[i]))\nif(sum(B) == N):\n print('0')\nelif(sum(B) < N):\n print(N - sum(B))\nelse:\n print('-1')"]
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s024993038', 's113814868', 's148968718', 's205269856', 's363407901', 's616384011', 's964448816', 's998008548', 's350657045']
[9520.0, 9676.0, 9668.0, 9532.0, 9236.0, 8960.0, 9532.0, 9568.0, 10060.0]
[24.0, 22.0, 25.0, 20.0, 23.0, 20.0, 22.0, 24.0, 24.0]
[162, 156, 167, 152, 154, 152, 153, 152, 189]
p02706
u337713602
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()))\n\nres = n - li.sum()\nif res >= 0:\n\tprint(res)\nelse:\n print(-1)', 'n, m = map(int,input().split())\nli = list(map(int, input().split()))\n \nres = n - sum(li)\nif res >= 0:\n\tprint(res)\nelse:\n print(-1)']
['Runtime Error', 'Accepted']
['s469618062', 's782777630']
[10040.0, 9884.0]
[24.0, 25.0]
[133, 133]
p02706
u340115305
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(""))\nC = 2 * math.pi * R\nprint(C)', 'n, m = map(int, input().split())\na = list(map(int, input().split()))\n\nx = n - sum(a)\nprint(x if x >= 0 else -1)']
['Runtime Error', 'Accepted']
['s461151591', 's234205576']
[9168.0, 10048.0]
[19.0, 25.0]
[59, 111]
p02706
u344065503
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(sum(a)-n)', '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', 'Wrong Answer', 'Accepted']
['s626815335', 's688559995', 's851460147']
[9996.0, 9884.0, 10052.0]
[26.0, 22.0, 22.0]
[77, 119, 119]
p02706
u350093546
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())\nx=sum(a)\nif n<x:\n print('-1')\nelse:\n print(n-x)", "N,M=map(int,input().split())\nA=list(map(int,input().split()))\n\nsum=sum(A)\n\nif N>=sum:\n print('N-sum')\nelse('-1')\n", 'N,M=map(int,input().split())\nA=list(map(int,input().split()))\n\nsum=sum(A)\n\nif N>=sum:\n print(N-sum)\nelse(-1)', "n,m=map(int,input().split())\na=list(map(int,input().split()))\nx=sum(a)\nif n<x:\n print('-1')\nelse:\n print(n-x)\n"]
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s121810984', 's274505272', 's891450909', 's199127052']
[9160.0, 8944.0, 8932.0, 10092.0]
[23.0, 24.0, 23.0, 24.0]
[104, 114, 109, 112]
p02706
u350412774
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())\nAs = list(map(int, input().split()))\n\nvacation = n-sum(As)\nif vacation < 0:\n\tprint('-1')\nelse:\n\tprint vacation", "n, m = map(int, input().split())\nAs = list(map(int, input().split()))\n\nvacation = n-sum(As)\nif vacation < 0:\n\tprint('-1')\nelse:\n\tprint(vacation)"]
['Runtime Error', 'Accepted']
['s409530146', 's112416532']
[8972.0, 10188.0]
[22.0, 25.0]
[143, 144]
p02706
u355371431
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 = N - sum(A)\nif sum(A) < N:\n print(-1)\nelse:\n print(ans)', 'N,M = map(int,input().split())\nA = list(map(int,input().split()))\n\nans = N - sum(A):\nif sum(A) < N\n print(-1)\nelse:\n print(ans)', 'N,M = map(int,input().split())\nA = list(map(int,input().split()))\n\nans = N - sum(A)\nif sum(A) < N\n print(-1)\nelse:\n print(ans)', 'N,M = map(int,input().split())\nA = list(map(int,input().split()))\n\nans = N - sum(A)\nif sum(A) > N:\n print(-1)\nelse:\n print(ans)']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s009512545', 's519851903', 's869674676', 's222062112']
[10060.0, 9004.0, 9004.0, 9996.0]
[20.0, 20.0, 21.0, 22.0]
[133, 133, 132, 133]
p02706
u363080243
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, len(a)= map(int, input().split())\na= list(map(int, input().split()))\nc= n-sum(a)\nprint(c)', 'n, len(a)= map(int, input().split())\na= list(map(int, input().split()))\nc= n-sum(a)\nprint(c)\n', 'n,m= map(int, input().split())\na = list(map(int, input().split()))\nc = n-sum(a)\nif m == len(a) and c>= 0:\n print(c)\nelse:\n print(-1)\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s215318421', 's890707513', 's158964036']
[9092.0, 9084.0, 10060.0]
[24.0, 21.0, 21.0]
[92, 93, 139]
p02706
u363836311
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(0.split())))\nt=0\nfor i in range(m):\n t+=A[i]\nif t>n:\n print(-1)\nelse:\n print(n-t)\n \n ', 'n,m=map(int, input().split())\nA=list(map(int, input().split()))\nt=0\nfor i in range(m):\n t+=A[i]\nif t>n:\n print(-1)\nelse:\n print(n-t)\n \n \n']
['Runtime Error', 'Accepted']
['s302858636', 's519467346']
[8980.0, 10116.0]
[23.0, 24.0]
[142, 142]
p02706
u364238528
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())\narr=list(map(int,input().rstrip().split()))\nsumm=0\nfor i in range(M) :\n\tsumm+=arr[i] \nif summ>=N :\n\tprint(-1)\nelse :\n print(N-summ)', 'arr=list(map(int,input().rstrip().split()))\nN=arr[0]\nM=arr[1]\narr=list(map(int,input().rstrip().split()))\nsumm=0\nfor i in range(M) :\n summ+=arr[i]\nif summ>N :\n print(-1)\nelse :\n print(N-summ)\n']
['Runtime Error', 'Accepted']
['s154113912', 's799412259']
[9184.0, 10060.0]
[21.0, 22.0]
[163, 201]
p02706
u367147039
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=n\n\nfor i in range(m):\n ans-=a[m]\n if ans<0:\n ans=-1\n break\nprint(ans)\n', 'n,m=map(int,input().split())\na=list(map(int,input().split()))\n\nans=n\n\nfor i in range(m):\n ans-=a[i]\n if ans<0:\n ans=-1\n break\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s980227083', 's409222715']
[9948.0, 10152.0]
[26.0, 29.0]
[157, 157]
p02706
u369039955
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.
['d, n = map(int, input().split())\na = map(int, input().split())\nremaining = d - sum(a)\nprint(d if d >= 0 else -1)', 'd, n = map(int, input().split())\na = map(int, input().split())\nremaining = d - sum(a)\nprint(remaining if remaining >= 0 else -1)']
['Wrong Answer', 'Accepted']
['s764768675', 's398838127']
[9512.0, 9364.0]
[24.0, 23.0]
[112, 128]
p02706
u374935093
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.
['data = input().rstrip().split(" ")\nprint(data)\nday = int(data[0])\ntask = int(data[1])\nneed = 0\nhw = input().rstrip().split(" ")\nfor i in range(task):\n need += int(hw[int(i)])\nanswer = day - need\nif answer >= 0:\n print(answer)\nelse:\n print("-1")\n\n', 'data = input().rstrip().split(" ")\nday = int(data[0])\ntask = int(data[1])\nneed = 0\nhw = input().rstrip().split(" ")\nfor i in range(task):\n need += int(hw[int(i)])\nanswer = day - need\nif answer >= 0:\n print(answer)\nelse:\n print("-1")']
['Wrong Answer', 'Accepted']
['s842796343', 's184177239']
[9532.0, 9660.0]
[22.0, 23.0]
[255, 241]
p02706
u379720557
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.
['/usr/local/bin/python3.8 /Users/tmohiro/Desktop/Atcoder/ABC163/B.py\n314 15\n9 26 5 35 8 9 79 3 23 8 46 2 6 43 3\n9\n\nProcess finished with exit code 0\n', 'n, m = map(int, input().split())\nA = list(map(int, input().split()))\n\ntotal = sum(A)\nif total > n:\n print(-1)\nelse:\n print(n-total)']
['Runtime Error', 'Accepted']
['s562836975', 's438756332']
[9004.0, 9876.0]
[22.0, 24.0]
[148, 137]
p02706
u382905693
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.
["\ndef main():\n nm = list(map(int, input().split()))\n a = list(map(int, input().split()))\n aa = nm[0] - sum(a)\n print(aa) if aa < 0 else print(-1)\n\nif __name__ == '__main__':\n main()\n", "\ndef main():\n nm = list(map(int, input().split()))\n a = list(map(int, input().split()))\n aa = nm[0] - sum(a)\n aa = aa if aa >= 0 else -1\n print(aa)\n\nif __name__ == '__main__':\n main()\n"]
['Wrong Answer', 'Accepted']
['s387608621', 's484531312']
[10056.0, 10196.0]
[23.0, 19.0]
[196, 202]
p02706
u385475040
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() for i in range(2)] \nli1 = list(map(int, s[0].split()))\nli2 = list(map(int, s[1].split()))\nk=0;\nfor j in li2:\n k+=j\n print(k)\nif li1[0] > k or li1[0] == k:\n print(li1[0]-k)\nelse:\n print('-1')", "s = [input() for i in range(2)] \nli1 = list(map(int, s[0].split()))\nli2 = list(map(int, s[1].split()))\nk=0;\nfor j in li2:\n k+=j\nif li1[0] > k or li1[0] == k:\n print(li1[0]-k)\nelse:\n print('-1')"]
['Wrong Answer', 'Accepted']
['s558286116', 's494874522']
[9904.0, 9724.0]
[26.0, 24.0]
[215, 202]
p02706
u389181816
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.
['#b\nn,m=[int(i)for i in input().split()]\narr=[]\nfor i in range(m):\n x=int(input())\n arr.append(x)\ns=sum(arr)\nif s>n:\n print(-1)\nelif s==n:\n print(0)\nelse:\n print(n-s)\n\n', '#b\nn,m=[int(i)for i in input().split()]\n\n arr=[int(i)for i in input().split()]\ns=sum(arr)\nif s>n:\n print(-1)\nelif s==n:\n print(0)\nelse:\n print(n-s)\n\n', '#b\nn,m=[int(i)for i in input().split()]\n\narr=[int(i)for i in input().split()]\ns=sum(arr)\nif s>n:\n print(-1)\nelif s==n:\n print(0)\nelse:\n print(n-s)\n\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s052119113', 's803119293', 's182046959']
[8960.0, 8844.0, 9848.0]
[24.0, 21.0, 22.0]
[172, 153, 151]
p02706
u392990133
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.
['user = list(eval(input().replace(" ",",")))\nprint(user)\nsum = 0\nfor i in user:\n if i == user[0]:\n continue\n elif i == user[1]:\n continue\n sum = sum + i\nprint(sum - user[0])', 'user1 = eval(input())\nuser2 = eval(input())\nuser = list(eval(input().replace(" ",",")))\nsum = 0\nfor i in user:\n sum = sum + i\nprint(user1 - sum)', 'N = eval(input())\nM = eval(input())\nuser = list(eval(input().replace(" ",",")))\nsum = 0\nfor i in user:\n sum = sum + i\nresult = N - sum\nif result < 0:\n print(-1)\nelse:\n print(result)', 'N,M = (input()).split()\ntask = input().split()\nlist1 = []\nsum = 0\nfor i in task:\n list1.append(i)\nfor j in list1:\n sum = sum + int(j)\nresult = int(N) - sum\nif result < 0:\n print(-1)\nelse:\n print(result)']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s271312407', 's621825705', 's931754617', 's689861359']
[9132.0, 9056.0, 9056.0, 9472.0]
[23.0, 22.0, 24.0, 23.0]
[195, 147, 190, 214]
p02706
u394731058
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 main():\n n, m = map(int, input().split())\n l = list(map(int, input(.split())))\n ans = n - sum(l)\n if ans < 0:\n ans = -1\n print(ans)\n\nif __name__ == '__main__':\n main()", "def main():\n n, m = map(int, input().split())\n l = list(map(int, input().split()))\n ans = n - sum(l)\n if ans < 0:\n ans = -1\n print(ans)\n\nif __name__ == '__main__':\n main()"]
['Runtime Error', 'Accepted']
['s786288153', 's058784489']
[9020.0, 9976.0]
[22.0, 24.0]
[182, 182]
p02706
u398355880
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())\nA=list(map(int,input()))\nprint(N-sum(A))', 'N,M=map(int,input().split())\nA=list(map(int,input().split()))\nprint(N-sum(A) if N-sum(A) >=0 else -1)\n']
['Runtime Error', 'Accepted']
['s136820689', 's872473546']
[9112.0, 9992.0]
[23.0, 25.0]
[61, 102]
p02706
u400982556
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 =[]\n\nfor i in range(M):\n A.append(int(input().split()))\n\ngokei = int(sum(A))\n\nif N - gokei < 0:\n print('-1')\n\nelse:\n print(N - gokei)", "N, M = map(int, input().split())\n\nA =[]\n\nfor i in range(M):\n A.append(input())\n\ngokei = int(sum(A))\n\nif N - gokei < 0:\n print('-1')\n\nelse:\n print(N - gokei)", "N, M = map(int, input().split())\n\nA =[]\n\nA = map(int,input().split())\n\ngokei = int(sum(A))\n\nif N - gokei < 0:\n print('-1')\n\nelse:\n print(N - gokei)\n\n"]
['Runtime Error', 'Runtime Error', 'Accepted']
['s133524470', 's245028647', 's293689365']
[9676.0, 9220.0, 9516.0]
[24.0, 18.0, 24.0]
[172, 159, 151]
p02706
u404678206
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())\nhw_days=0\nfor i in range(m):\n hw_days+=int(input())\nprint(n-hw_days if (n-hw_days)>0 else -1)', 'n,m=map(int,input().split())\nlist1=list(map(int,input().split()))\nans=n-sum(list1)\nprint(ans if ans>=0 else -1)\n \n']
['Runtime Error', 'Accepted']
['s202735924', 's670380437']
[9256.0, 9808.0]
[23.0, 23.0]
[123, 115]
p02706
u406379114
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()))\nd = n-sum(a)\nif(a<0):\n d = -1\npritn(d)', 'n, m = map(int, input().split())\na = list(map(int, input().split()))\nd = n-sum(a)\nif(d<0):\n d = -1\nprint(d)']
['Runtime Error', 'Accepted']
['s427824374', 's252535495']
[10028.0, 9892.0]
[24.0, 26.0]
[108, 108]
p02706
u406767170
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 = map( int, input().split() )\na = 0\nfor i in range(m)\n\ta += int(input())\n\nn=n-a\nif a<=-2:\n a=-1\n\nprint(a)', 'n, m = map( int, input().split() )\na = list(map(int,input().split()))\nsum=0\nfor i in range(m):\n sum+=a[i]\n\nn=n-sum\nif n<=-2:\n n=-1\n\nprint(n)']
['Runtime Error', 'Accepted']
['s611625496', 's501921890']
[8936.0, 9992.0]
[20.0, 22.0]
[111, 142]
p02706
u408148811
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()))\ns=sum(a)\nif sum>n:\n print(-1)\nelse:\n print(n-s)', 'n,m=map(int,input().split())\na=list(map(int,input().split()))\ns=sum(a)\nif s>n:\n print(-1)\nelse:\n print(n-s)\n\n']
['Runtime Error', 'Accepted']
['s568241270', 's817876362']
[9884.0, 10044.0]
[22.0, 25.0]
[111, 111]
p02706
u408620326
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 main():\n import sys\n import math\n sys.setrecursionlimit(10 ** 6)\n input = sys.stdin.readline\n r = int(input())\n print(2*r*math.pi)\n\nif __name__ == '__main__':\n main()", "def main():\n import sys\n sys.setrecursionlimit(10 ** 6)\n input = sys.stdin.readline\n N, M = [int(x) for x in input().strip().split()]\n A = sum([int(x) for x in input().strip().split()])\n if N - A < 0:\n print(-1)\n else:\n print(N - A)\n\nif __name__ == '__main__':\n main()"]
['Runtime Error', 'Accepted']
['s651642310', 's981944508']
[9176.0, 9984.0]
[19.0, 21.0]
[191, 306]
p02706
u411397651
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.
['list = input().split()\nN = int(list[0])\n\nlist_1 = input().split()\nM = int(sum(list_1))\n\nif M-N > 0 :\n print(M-N)\nelse:\n print(-1)', 'list = int(input().split())\nN = list[0]\n\nlist_1 = int(input().split())\nM = sum(list_1)\n\nif M-N > 0 :\n print(M-N)\nelse:\n print(-1)\n', 'line_1 = input().split()\nN = int(line_1[0])\nline_2 = input().split()\nM = list(map(int,line_2))\n\nMs = sum(M)\n\nif Ms-N > 0 :\n print(Ms-N)\nelse:\n print(-1)', 'line_1 = input().split()\nN = int(line_1[0])\nline_2 = input().split()\nM = list(map(int,line_2))\n\nMs = sum(M)\n\nprint(Ms-N)', 'list = input().split()\nN = int(list[0])\n\nlist_1 = input().split()\nM = int(sum(list_1))\n\nprint(M-N)\n', 'list = input().split()\nN = int(list[0])\n\nlist_1 = input().split()\nM = int(list_1.sum())\n\nprint(M)', 'n, m = [int(num) for num in input().split()]\nassments = sum(int(num) for num in input().split())\nif n - assments < 0:\n print(-1)\nelse:\n print(n - assments)\n']
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s203816699', 's362670288', 's547408063', 's626305250', 's798601670', 's821714764', 's700817497']
[9500.0, 8932.0, 10048.0, 10096.0, 9480.0, 9532.0, 9472.0]
[21.0, 20.0, 21.0, 23.0, 22.0, 21.0, 21.0]
[131, 132, 154, 120, 99, 97, 162]
p02706
u415905784
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())\nprint(max(N - sum([int(x) for x in input.split()]), -1))', 'N, M = map(int, input().split())\nprint(max(N - sum([int(x) for x in input().split()]), -1))']
['Runtime Error', 'Accepted']
['s256846865', 's520406071']
[9176.0, 9996.0]
[23.0, 22.0]
[89, 91]
p02706
u416779002
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())\nA = list(map(int, input().split()))\nsum=0\nfor i in range(M):\n sum+=A[i]\nif N-sum<0:\n print(-1)\nelse:\n print(N-sum)\n', 'N,M= int(input())\nA = list(map(int, input().split()))\nsum=0\nfor i in range(M)\n sum+=A[i]\nif N-sum<0: \n print(-1)\nelse:\n print(N-sum) \n', 'N, M = map(int, input().split())\nA = list(map(int, input().split()))\nsum=0\nfor i in range(M):\n sum+=A[i]\nif N-sum<0:\n print(-1)\nelse:\n print(N-sum)\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s279073461', 's491265921', 's390865612']
[9168.0, 8964.0, 10188.0]
[22.0, 21.0, 24.0]
[142, 149, 157]
p02706
u423665486
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 resolve():\n input().split()\n map(int, input().split())\n list(map(int, input().split()))\nresolve()', 'def resolve():\n\tn, m = map(int, input().split())\n\ta = list(map(int, input().split()))\n\tprint(n-sum(a) if n-sum(a) > -1 else -1)\nresolve()']
['Runtime Error', 'Accepted']
['s421350844', 's252701486']
[9340.0, 10188.0]
[23.0, 24.0]
[110, 137]
p02706
u427163848
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 i in range(M):\n A = A + int(input())\nans = N - A\nif ans >= 0:\n print(ans)\nelse :\n print(-1)', 'N,M = map(int, input().split())\nA = list(map(int, input().split()))\nans = 0\nfor i in range(M):\n ans+=A[i]\nans = N - ans\nif ans >= 0:\n print(ans)\nelse :\n print(-1)']
['Runtime Error', 'Accepted']
['s962299605', 's203379740']
[9200.0, 10196.0]
[21.0, 22.0]
[142, 171]
p02706
u430336181
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 = [input() for _ in range(M)]\ns_A = sum(A)\nif N >= s_A:\n print(N-s_A)\nif N < s_A:\n print(-1)', 'N, M = map(int, input().split())\nA = [int(input()) for _ in range(M)]\ns_A = sum(A)\n\nif N - s_A >= 0:\n print(N - s_A)\n exit()\nif N - s_A < 0:\n print(-1)\n exit()\n', 'N, M = map(int, input().split())\nA = [int(input()) for _ in range(M)]\ns_A = sum(A)\n\nif N - s_A>= 0:\n print(N - s_A)\nif N -s_A < 0:\n print(-1)\n\n', 'N, M = map(int, input().split())\nA = [int(input()) for _ in range(M)]\ns_A = sum(A)\nif N >= s_A:\n print(N - s_A)\nif N < s_A:\n print(-1)\n\n', 'N, M = map(int, input().split())\nA = [int(input()) for _ in range(M)]\ns_A = sum(A)\n\nif N >= s_A:\n print(N - s_A)\nelif N < s_A:\n print(-1)\n\n', 'n,m=map(int,input().split())\na=list(map(int,input().split()))\nfor i in a:\n n-=i\n if n<0: \n print(-1)\n exit()\nprint(n)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s167210619', 's853472931', 's878722462', 's918410693', 's958584417', 's126206666']
[9224.0, 9156.0, 9172.0, 9148.0, 9192.0, 10060.0]
[23.0, 22.0, 20.0, 24.0, 20.0, 23.0]
[133, 172, 149, 142, 145, 198]
p02706
u437215432
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 range(m):\n a[i] = int(input())\n\nans = n - sum(a)\nif ans > 0:\n print(ans)\nelse:\n print(-1)\n', '# ABC163B\n\nn, m = map(int, input().split())\na = list(map(int, input().split()))\n\nans = n - sum(a)\nif ans >= 0:\n print(ans)\nelse:\n print(-1)\n']
['Runtime Error', 'Accepted']
['s373162453', 's648675923']
[9288.0, 9864.0]
[21.0, 21.0]
[153, 146]
p02706
u438101590
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.
['t=list(map(int,input().split()))\t\t\ns=list(map(int,input().split()))\t\t\n\ntemp = 0\nfor i in s:\n temp += i\n \nif(s[0]-temp>=0):\n print(s[0]-temp)\nelse:\n print(-1)\n \n ', 't=list(map(int,input().split()))\t\t\ns=list(map(int,input().split()))\t\t\n \ntemp = 0\nfor i in s:\n temp += i\n\n# print(temp)\nif(t[0]-temp>=0):\n print(s[0]-temp)\nelse:\n print(-1)', '\n\n\n\nt=list(map(int,input().split()))\t\t\ns=list(map(int,input().split()))\t\t\n \ntemp = 0\nfor i in s:\n temp += i\n\nprint(temp)\nif(t[0]-temp>=0):\n print(s[0]-temp)\nelse:\n print(-1)', 't=list(map(int,input().split()))\t\t\ns=list(map(int,input().split()))\t\t\n \ntemp = 0\nfor i in s:\n temp += i\n\n# print(temp)\nif(t[0]-temp>=0):\n print(t[0]-temp)\nelse:\n print(-1)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s205685296', 's224439009', 's478943626', 's601761226']
[10216.0, 10124.0, 9884.0, 9884.0]
[21.0, 23.0, 21.0, 24.0]
[167, 174, 176, 174]
p02706
u439706453
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=S[0]\nN=int(N)\ndel S[0]\nM=S[0]\nM=int(M)\ndel S[0]\ns=0\nfor i in range(M):\n s=s+int(S[i])\nif s>N:\n print(-1)\nelse:\n print(N-s)\n', 'S=input().split()\nN=S[0]\nN=int(N)\ndel S[0]\nM=S[0]\nM=int(M)\ndel S[0]\ns=0\nfor i in range(M):\n s=s+int(S[i])\nif s>N:\n print(-1)\nelse:\n print(N-s)\n', 'n,m=map(int,input().split())\nl=list(map(int,input().split()))\nsum=0\nfor i in range(m):\n sum+=l[i]\nif sum>n:\n print(-1)\nelse:\n print(n-sum)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s064465435', 's873101484', 's473554624']
[9200.0, 9128.0, 9988.0]
[23.0, 21.0, 28.0]
[152, 152, 141]
p02706
u440608859
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()))\nk=sum(l)\nif k>n:\n print(-1)\nelse:\n print(n-k)', 'n,m=map(int,input().split())\nl=list(map(int,input().split()))\nk=sum(l)\nif k>n:\n print(-1)\nelse:\n print(n-k)']
['Runtime Error', 'Accepted']
['s021029076', 's530671639']
[9200.0, 9876.0]
[21.0, 22.0]
[105, 113]
p02706
u441246928
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(max(-1, N - sum(A)))', 'N,M = map( int,input().split())\nA = list(map(int,input().split())\nprint(max(-1,N - sum(A)))', 'N,M = map( int,input().split())\nA = list(map(int,input().split())\nprint(N - sum(A))', 'N,M = map( int,input().split())\nA = list(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)))', 'N,M = map( int, input().split() )\nA = list( map(int, input().split() ))\nprint(max(-1, N - sum(A)))']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s423162626', 's434814511', 's538952350', 's600886035', 's689578625', 's233781080']
[8928.0, 8976.0, 8964.0, 8920.0, 8976.0, 9984.0]
[23.0, 24.0, 20.0, 19.0, 22.0, 23.0]
[97, 91, 83, 91, 97, 98]
p02706
u445036147
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();\na = input().split();\n\na_sum = sum(a);\n\nif n - a_sum < 0:\n print(-1)\nelse:\n print(n-a_sum)\n \n', 'n,m = input().split();\na = input().split();\n\na_sum = sum(a);\n\nrest_day = int(n) - a_sum\n\nif rest_day < 0:\n rest_day = -1\n\nreturn rest_day\n ', '\nn,m = input().split();\na = input().splite();\n\na_sum = sum(a);\n\nrest_day = int(n) - a_sum\n\nif rest_day < 0:\n rest_day = -1\n\nreturn rest_day', '\nn,m = input().split();\na = input().splite();\n\na_sum = sum(a);\n\nrest_day = n - a_sum\n\nif rest_day > 0:\n return rest_day\nelse: return -1\n', 'n,m = map(int,input().split())\na = list(map(int,input().split()))\n\na_sum = sum(a);\n\nif n - a_sum < 0:\n print(-1)\nelse:\n print(n-a_sum)\n\n ']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s304114905', 's748209712', 's875493375', 's951306140', 's297536297']
[9308.0, 8872.0, 9008.0, 8992.0, 10136.0]
[21.0, 22.0, 22.0, 21.0, 24.0]
[124, 145, 142, 139, 146]
p02706
u449446168
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())\nday_list = input().split()\n\nt = 0\n\nfor A in day_list:\n t += A\n\nif N - t < 0: print(-1)\nelse: print(N - t)', 'N,M = map(int,input().split())\nday_list = input().split()\n\nt = 0\n\nfor A in day_list:\n t += int(A)\n\nif N - t < 0: print(-1)\nelse: print(N - t)']
['Runtime Error', 'Accepted']
['s110453420', 's708935820']
[9592.0, 9536.0]
[26.0, 23.0]
[139, 144]
p02706
u451233002
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())\nA = list(map(int, input().split())) \nS = 0\nfor i in M:\n S += A[i]\nprint (N-S)', 'N,M = map(int,input().split()) \nA = list(map(int, input().split())) \nS = 0\nfor i in range(M):\n S += A[i]\nF = N-S\nif F>=0:\n print(F)\nelse:\n print(-1)']
['Runtime Error', 'Accepted']
['s806343806', 's341464954']
[9172.0, 10032.0]
[20.0, 24.0]
[97, 154]
p02706
u454866339
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().sprit())\nA = list(map(int,input().sprit()))\n\nenjoy = N - sum(A)\n\nif N >= sum(A):\n print(enjoy)\n\nelse:\n print('-1')", "N, M = map(int, input().split())\nA = list(map(int, input().split()))\n\nenjoy = N - sum(A)\n\nif N >= sum(A):\n print(enjoy)\n\nelse:\n print('-1')"]
['Runtime Error', 'Accepted']
['s399609952', 's876579844']
[9060.0, 9828.0]
[26.0, 31.0]
[143, 145]
p02706
u463281863
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\nASOBU = sum(A) - N\n\nif ASOBU >= 0:\n print(ASOBU)\nelse:\n print('-1')", "N, M = map(int, input().split())\nA = list(map(int, input().split()))\n\nASOBU = N - sum(A)\n\nif ASOBU >= 0:\n print(ASOBU)\nelse:\n print('-1')"]
['Wrong Answer', 'Accepted']
['s772850971', 's278432954']
[9880.0, 9844.0]
[23.0, 23.0]
[143, 143]
p02706
u464440434
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,A_i=(int(x) for x in input().split())\nA=0\nfor i in range(M):\n A+=A_i\nif N<A:\n print("-1")\n\nelse:\n print(N-A)', 'N,M,A_i=(int,input().split())\nA=0\nfor i in range(M):\n A+=A_i\nif N<A:\n print("-1")\n\nelse:\n print(N-A)\n', 'N,M=map(int,input().split())\nA_i=list(map(int,input().split()))\nA=0\nfor i in range(M):\n A+=A_i[i]\n \nif N<A:\n print("-1")\n\nelse:\n print(N-A)\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s290590442', 's541191771', 's718064972']
[9172.0, 9024.0, 9856.0]
[20.0, 23.0, 25.0]
[121, 110, 152]
p02706
u465652095
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 = [int(input()) for i in range(M)]\n\nfor i in range(M):\n N = N - i\n if N < 0:\n print(-1)\n break\nprint(N)', 'N,M = map(int,input().split())\nHW = list(map(int,input().split()))\n\nL = N - sum(HW)\nif L < 0:\n print(-1)\nelse:\n print(L)']
['Runtime Error', 'Accepted']
['s779433864', 's117723988']
[9116.0, 9848.0]
[20.0, 21.0]
[162, 126]
p02706
u467881696
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.
["nm = list(map(int, input().split()))\nam = list(map(int, input().split()))\nx = 0\nfor i in range(len(am)):\n x += am[i]\nif x > nm[0]:\n print('-1')\nelse:\n print(x)", "nm = list(map(int, input().split()))\nam = list(map(int, input().split()))\nx = 0\nfor i in range(len(am)):\n x += am[i]\nif x > nm[0]:\n print('-1')\nelse:\n ans = nm[0] - x\n print(ans)"]
['Wrong Answer', 'Accepted']
['s915851208', 's002912472']
[9984.0, 9880.0]
[23.0, 24.0]
[168, 190]
p02706
u468663659
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_data = input()\na = a_data.split(' ')\n\nsum = sum(a)\n\nif sum > N:\n print(-1)\nelse:\n print(N-sum)", "N, M = map(int, input().split())\na_data = input()\na = a_data.split(' ')\n\nsum = 0\n\nfor item as a:\n sum += int(item)\n\nif sum > N:\n print(-1)\nelse:\n print(N-sum)\n", "N, M = map(int, input().split())\na_data = input()\na = a_data.split(' ')\n\nsum = 0\n\nfor item in a:\n sum += int(item)\n\nif sum > N:\n print(-1)\nelse:\n print(N-sum)\n"]
['Runtime Error', 'Runtime Error', 'Accepted']
['s338070134', 's779958183', 's615778211']
[9660.0, 9012.0, 9548.0]
[21.0, 22.0, 20.0]
[131, 176, 176]
p02706
u474122160
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()\nn,m\nf=input().split()\ns=0\nfl=0\nfor i in range(0,int(a[1])):\n if(s>=int(a[0])):\n break\n fl+=1\nif(fl!=1):\n print(int(a[0])-s)\nelse:\n print("-1")\n \n\t\n', 'import math\na=input().split()\nn,m=int(a[0]),int(a[1])\nf=list(map(int,input().split()))\ns=0\nfl=0\ns=sum(a)\nif(s>=n):\n print(s-n)\nelse:\n print("-1")', 'import math\na=input().split()\nf=input().split()\ns=0\nfl=0\nfor i in range(0,int(a[1])):\n if(s>=int(a[0])):\n break\n fl+=1\nif(fl!=1):\n print(int(a[0])-s)\nelse:\n print("-1")\n \n\t\n', 'import math\na=input().split()\nn,m=int(a[0]),int(a[1])\nf=list(map(int,input().split()))\ns=0\nfl=0\ns=sum(f)\nif(n>=s):\n print(n-s)\nelse:\n print("-1")\n']
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s362824537', 's648022697', 's993279567', 's163288729']
[9000.0, 10040.0, 9592.0, 10112.0]
[22.0, 20.0, 25.0, 24.0]
[204, 147, 200, 148]
p02706
u478784503
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.
['# py abc163b.py\nn,m = map(int,input().split())\nval = sum(list(map(int,input().split())))\nif val>m:\n\tprint(-1)\nelse\n\tprint(m-val)', '# py abc163b.py\nn,m = map(int,input().split())\nval = sum(list(map(int,input().split())))\nif val>n:\n\tprint(-1)\nelse:\n\tprint(n-val)']
['Runtime Error', 'Accepted']
['s630577602', 's870213898']
[8956.0, 9976.0]
[23.0, 23.0]
[128, 129]
p02706
u483884608
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()\nwhile n>0:\n m=m-int(input())\n n=n-1\nif m>=0:\n print(m)\nelse:\n print(-1)', 'm,n=input().split()\nwhile n>0:\n m=m-int(input())\n n=n-1\nprint(n)', 'm,n=map(int,input().split())\na=input().split()\nwhile n>0:\n m= m-a[n-1]\n n=n-1\nif m>=0:\n print(m)\nelse:\n print(-1)', 'm,n=map(int,input().split())\na=list(map(int,input().split()))\nwhile n>0:\n m= m-a[n-1]\n n=n-1\nif m>=0:\n print(m)\nelse:\n print(-1)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s014495188', 's146324391', 's187707985', 's247075101']
[9100.0, 9088.0, 9664.0, 10060.0]
[19.0, 20.0, 23.0, 23.0]
[95, 66, 117, 132]
p02706
u488884575
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.
['314 15\n9 26 5 35 8 9 79 3 23 8 46 2 6 43 3', "N, M = list(map(int, input().split()))\nA = list(map(int, input().split()))\nif N- sum(A) >= 0:\n print(N- sum(A))\nelse:\n print('-1')"]
['Runtime Error', 'Accepted']
['s214903966', 's174893425']
[9012.0, 9984.0]
[20.0, 25.0]
[42, 136]
p02706
u488934106
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 b163(n, m, al):\n\n\n return n - sum(al) if n - sum(al) < 0 else "-1"\n\ndef main():\n n , m = map(int, input().split())\n al = list(map(int, input().split()))\n print(b163(n, m, al))\n\nif __name__ == \'__main__\':\n main()', 'def b163(n, m, al):\n\n\n return n - sum(al) if n - sum(al) >= 0 else "-1"\n\ndef main():\n n , m = map(int, input().split())\n al = list(map(int, input().split()))\n print(b163(n, m, al))\n\nif __name__ == \'__main__\':\n main()']
['Wrong Answer', 'Accepted']
['s612186814', 's767005205']
[9880.0, 10116.0]
[23.0, 23.0]
[230, 231]
p02706
u491510415
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 i in input().split()]\nif sum(a)-n<0:\n print(-1)\nelse:\n print(sum(a)-n)', 'm=map(int,input().split())\na=[int(x) for x in input().split()]\nif sum(a)-n<0:\n print(-1)\nelse:\n print(sum(a)-n)', 'n,m=map(int,input().split())\na=[int(x) for x in input().split()]\nif n-sum(a)<0:\n print(-1)\nelse:\n print(n-sum(a))']
['Runtime Error', 'Runtime Error', 'Accepted']
['s350544362', 's663550703', 's244117504']
[9016.0, 10056.0, 10192.0]
[23.0, 22.0, 24.0]
[117, 114, 115]
p02706
u493318999
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 = sum(a)\nif n-sum >= 0:\n\tprint(n-sum)\nelse:\n\tprint(-1)', 'n,m = map(int,input().split())\na = list(map(int,input().split()))\nsum = sum(a)\nif n-sum >= 0:\n\tprint(n-sum)\nelse:\n\tprint(-1)']
['Runtime Error', 'Accepted']
['s545764647', 's434142007']
[9108.0, 10192.0]
[21.0, 23.0]
[125, 124]
p02706
u493373637
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())\npi = 3.14159265358979\nprint(2*r*pi)', 'r = int(input())\nimport math\nprint(2*r*math.pi)', 'def solve():\n N, M = map(int, input().split())\n hws = list(map(int, input().split()))\n for i in hws:\n N -= i\n if (N<0):\n print(-1)\n return\n\n print(N)\n\nsolve()']
['Runtime Error', 'Runtime Error', 'Accepted']
['s147432276', 's392593102', 's889119445']
[9164.0, 9148.0, 9836.0]
[23.0, 26.0, 22.0]
[52, 47, 206]
p02706
u493407368
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 = input().split() \n\na = sum(int(i) for i in a)\n\nasobi = n -a\nif asobi => 0:\n print(asobi)\nelse:\n print(-1)', 'n, m = map(int, input().split())\na = input().split() \n\na = sum(int(i) for i in a)\n\nasobi = n -a\nif asobi >= 0:\n print(asobi)\nelse:\n print(-1)']
['Runtime Error', 'Accepted']
['s739786436', 's213771746']
[9024.0, 9588.0]
[24.0, 22.0]
[143, 143]
p02706
u494420380
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.
["map(int, input().split(' '))\n", 'a = list(map(int, input().split(\' \')))\nb = sum(list(map(int, input().split(\' \'))))\n\nif a[0] >= b:\n print(a[0] - b)\nelse:\n print("-1")']
['Wrong Answer', 'Accepted']
['s946278362', 's537399030']
[9056.0, 10008.0]
[22.0, 20.0]
[29, 135]
p02706
u497188176
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())\nN=N-M\nif 0<N:\n print(N)\nelif 0==N:\n print(0)\nelse:\n print(-1)', 'N=int(input())\nM=int(input())\nN=N-M\nif 0<N:\n print(N)\nelif 0=N:\n print(0)\nelse:\n print(-1)', '"N,M".split(",")\nN=N-M\nif =0<N:\n print(N)\nelse:\n print(-1)', 'N=int(input())\nM=int(input())\nif N>M:\n print(N-M)\nelse:\n \tprint(-1)', 'N=int(input())\nif N>M:\n print(N-M)\nelse:\n print(-1)', 'N=int(input())\nM=int(input())\nN=N-M\nif N>0=:\n print(N)\nelse:\n print(-1)', 'N,M=map(int,input().split())\nN=N-M\nif =0<N:\n print(N)\nelse:\n print(-1)', 'N=int(input())\nM=int(input())\nN=N-M\nif N>0:\n print(N)\nelse:\n print(-1)', 'N=int(input())\nM=int(input())\nif N>M>:\n print(N-M)\nelse:\n print(-1)', 'N,M=map(int,input().split())\nN=N-M\nif 0<=N:\n print(N)\nelse:\n print(-1)\n', 'N=int(input())\nM=int(input())\nif N>M:\n print(N-M)\nelse:\n print(-1)', 'N=int(input())\nM=int(input())\nif N>M:\n print(N-M)\nelse:\n print(-1)', 'N=int(input())\nM=int(input())\nif N>M:\n \tprint(N-M)\nelse:\n \tprint(-1)', 'N,M=map(int,input().split())\nA=list(map(int,input().split()))\nB=0\nfor i in A:\n B=B+i \nN=N-B\nif 0<=N:\n print(N)\nelse:\n print(-1)\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s048287667', 's188900662', 's243132136', 's288073556', 's409577878', 's414229794', 's467832324', 's813731967', 's859128226', 's870434400', 's901524980', 's903722415', 's916790668', 's618890647']
[9156.0, 9024.0, 9024.0, 9152.0, 9172.0, 9012.0, 9012.0, 9184.0, 9024.0, 9188.0, 9120.0, 9164.0, 9176.0, 10064.0]
[20.0, 23.0, 21.0, 20.0, 23.0, 24.0, 20.0, 20.0, 24.0, 20.0, 21.0, 19.0, 20.0, 20.0]
[97, 96, 62, 71, 53, 75, 74, 74, 71, 75, 70, 68, 70, 143]
p02706
u499267715
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\nimport numpy as np\n\ndef main():\n N,M = (int(x) for x in input().split())\n A = [int(x) for x in input().split(M)]\n \n for i in range(M):\n N = N - A[i]\n \n if N < 0:\n print('-1')\n else:\n print(N) \n \nif __name__ == '__main__':\n main()", "import math\nimport numpy as np\n\ndef main():\n N,M = (int(x) for x in input().split())\n A = [int(x) for x in input().split()]\n \n for i in range(M):\n N = N - A[i]\n \n if N < 0:\n print('-1')\n else:\n print(N) \n \nif __name__ == '__main__':\n main()"]
['Runtime Error', 'Accepted']
['s866172249', 's247835833']
[27156.0, 27700.0]
[114.0, 107.0]
[260, 259]
p02706
u501254456
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()\nA = input().split()\nN , M = int(N) , int(M)\nfor i in range(M):\n A[i] = int(A[i])\nprint(A , M , N)\nfor i in range(M):\n N -= A[i]\nif N < -1:\n N = -1\nprint(N)\n', 'N , M = input().split()\nA = input().split()\nN , M = int(N) , int(M)\nfor i in range(M):\n A[i] = int(A[i])\n#print(A , M , N)\nfor i in range(M):\n N -= A[i]\nif N < -1:\n N = -1\nprint(N)\n']
['Wrong Answer', 'Accepted']
['s319871214', 's362323017']
[9876.0, 9440.0]
[27.0, 24.0]
[193, 194]
p02706
u501986378
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().split()\n\nN = int(a[0])\nM = int(a[1])\n\nprint(N)\nprint(M)\n\nb = 0\nc = []\n\nwhile True:\n if b >= M:\n \tbreak\n e = input(int())\n c.append(e)\n b += 1\n\nd = 0\n \nfor i in c:\n d += int(i)\n\nif d > N:\n print(-1)\nelse:\n print(N-d)', 'a = input().split()\n\nN = int(a[0])\nM = int(a[1])\n\n\nb = 0\nc = []\n\nwhile True:\n if b >= M:\n \tbreak\n e = int(input())\n c.append(e)\n b += 1\n\nd = 0\n \nfor i in c:\n d += int(i)\n\nif d > N:\n print(-1)\nelse:\n print(N-d)', 'a = input().split()\n\nN = int(a[0])\nM = int(a[1])\n\nb = 0\nc = []\n\nwhile True:\n if b >= M:\n \tbreak\n e = input(int())\n c.append(e)\n b += 1\n\nd = 0\n \nfor i in c:\n d += int(i)\n\nif d > N:\n print(-1)\nelse:\n print(N-d)', 'a = int().input()\n\nN = a[0]\nM = a[1]\n\nb = 0\nc = []\n\nwhile true:\n if b > M:\n \tbreak\n e = input(int())\n c.append(e)\n b += 1\n\nd = 0\n \nfor i in c:\n d += i\n\nif d > N:\n print(-1)\nelse:\n print(N-d)\n', 'a = input().split()\n\nN = int(a[0])\n\n\nc = input().split()\n\n\n\nd = 0\n \nfor i in c:\n d += int(i)\n\nif d > N:\n print(-1)\nelse:\n print(N-d)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s039780752', 's136018846', 's214895287', 's491277564', 's986144836']
[9260.0, 9304.0, 9256.0, 9052.0, 9452.0]
[22.0, 22.0, 21.0, 23.0, 22.0]
[236, 218, 217, 200, 136]
p02706
u513786905
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().rstrip()\n\nn = int(n_m[0])\nm = int(n_m[1])\n\na_i = input().rstrip().split(' ')\na_i_list = [int(i) for i in a_i[m]]\n\nfinish_day = sum(a_i_list)\n\nif n >= finish_day:\n ans = n - finish_day\n print(ans)\nelse:\n print('-1')\n", "n_m = input().rstrip().split(' ')\n\nn = int(n_m[0])\nm = int(n_m[1])\n\na_i = input().rstrip().split(' ')\na_i_list = [int(i) for i in a_i[:m]]\n\nfinish_day = sum(a_i_list)\n\nif n >= finish_day:\n ans = n - finish_day\n print(ans)\nelse:\n print('-1')\n"]
['Runtime Error', 'Accepted']
['s932954228', 's753911896']
[9536.0, 10056.0]
[21.0, 22.0]
[232, 244]
p02706
u514894322
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.
['print(int(input())*6.283)\n', 'print(int(input())*6.283)\n', 'n,m = map(int,input().split())\ns = sum(map(int,input().split()))\nprint(max([n-s,-1]))']
['Runtime Error', 'Runtime Error', 'Accepted']
['s226892118', 's846882662', 's507258372']
[9028.0, 9112.0, 9336.0]
[23.0, 23.0, 22.0]
[26, 26, 85]
p02706
u520331522
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.
[' = map(int,input().split())\nl = list(map(int,input().split()))\ns = 0\nfor i in range(n):\n s += l[i]\nprint(max(m-s,-1))', 'm,n = map(int,input().split())\nl = list(map(int,input().split()))\ns = 0\nfor i in range(n):\n s += l[i]\nprint(max(m-s,-1))\n']
['Runtime Error', 'Accepted']
['s162067029', 's092092804']
[9008.0, 10048.0]
[23.0, 21.0]
[118, 122]
p02706
u526060466
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()))\nif(sum(l)<n):\n print(-1)\nelse:\n print(n-sum(l))', 'n,m = map(int, input().split())\nl = list(map(int, input().split()))\nif(sum(l)>n):\n print(-1)\nelse:\n print(n-sum(l))']
['Wrong Answer', 'Accepted']
['s566632678', 's371130543']
[9984.0, 9884.0]
[25.0, 21.0]
[117, 121]
p02706
u529737989
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())))\nsumA = sum(A)\nif N-sumA < 0:\n print(-1)\nelse:\n print(N-sumA)', 'N,M = map(int,input().split())\nA = list(map(int,input().split()))\nsumA = sum(A)\nif N-sumA < 0:\n print(-1)\nelse:\n print(N-sumA)']
['Runtime Error', 'Accepted']
['s924992110', 's499357892']
[9104.0, 10108.0]
[23.0, 29.0]
[130, 128]
p02706
u530339790
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())\nc = sum(map(int, input().split()))\n\nprint(max([c - a, -1]))', 'a, b = map(int, input().split())\nc = sum(map(int, input().split()))\n\nprint(max(c - a, -1))', 'a, b = map(int, input().split())\nc = sum(map(int, input().split()))\n\nprint(max(a - c, -1))']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s110368633', 's125587652', 's562506072']
[9656.0, 9528.0, 9580.0]
[22.0, 24.0, 22.0]
[92, 90, 90]
p02706
u531219227
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,inuput().split())\nA = list(map(int,input().split()))\n\ntotal = 0\nfor i in range(M):\n total += A[i]\n \nif N - total >= 0:\n print(N - total)\n \nelse:\n print("-1")', 'N,M = map(int,input().split())\nA = list(map(int,input().split()))\n\ntotal = 0\nfor i in range(M):\n total += A[i]\n \nif N - total >= 0:\n print(N - total)\n \nelse:\n print("-1")\n']
['Runtime Error', 'Accepted']
['s221562335', 's077955320']
[9084.0, 10008.0]
[22.0, 24.0]
[176, 176]
p02706
u531220228
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\nplay_days = copy.copy(N)\nfor i in A:\n play_days -= i\nif play_days < 0:\n print(-1)\nelse:\n print(play_days)', 'N,M = map(int, input().split())\nA = map(int, input().split()) \n\nplay_days = N\nfor i in A:\n play_days -= i\nif play_days < 0:\n print(-1)\nelse:\n print(play_days)']
['Runtime Error', 'Accepted']
['s598556553', 's074288400']
[9668.0, 9668.0]
[26.0, 24.0]
[172, 161]
p02706
u531456543
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 = [ int(i) for i in input().split() ]\n\nif n - lst.sum() >= 0:\n print(n-lst.sum())\nelse:\n print(-1)', 'n, m = map(int, input().split())\nlst = [ int(i) for i in input().split() ]\n\nif n - sum(lst) >= 0:\n print(n-sum(lst))\nelse:\n print(-1)\n']
['Runtime Error', 'Accepted']
['s052079434', 's851304775']
[10008.0, 9864.0]
[27.0, 30.0]
[137, 136]
p02706
u531599639
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())\nlist = list(map(int, input().split()))\nm=0\nfor i in range (0, len(list)):\n\tm=m+list[i]\nif N-m>=0:\nprint(N-m)\nelse:\nprint(-1)', 'N, M = map(int, input().split())\nlist = list(map(int, input().split()))\n \nm=0\nfor i in range (0, len(list)):\n\tm=m+list[i]\n \nif N-m>=0:\nprint(N-m)\nelif N-m<0:\nprint(-1)', 'N, M = map(int, input().split())\nlist = list(map(int, input().split()))\nm=0\nfor i in range (0, len(list)):\n\tm=m+list[i]\nif N-m>=0:\nprint(N-m)\nelse:\nprint(0)', 'N, M = map(int, input().split())\nlist = list(map(int, input().split()))\nm=0\nfor i in range (0, len(list)):\n\tm=m+list[i]\nif N-m>=0:\nprint(N-m)\nelse:\nprint(0)', 'N, M = map(int, input().split())\nlist = list(map(int, input().split()))\n \nm=0\nfor i in range (0, len(list)):\n\tm=m+list[i]\nif N-m>=0:\n\tprint(N-m)\nelif N-m<0:\n\tprint(-1)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s068409455', 's260636748', 's397781876', 's597815283', 's580097520']
[9040.0, 9040.0, 8968.0, 9032.0, 10192.0]
[24.0, 19.0, 22.0, 24.0, 25.0]
[157, 167, 156, 156, 167]
p02706
u532107923
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 = map(int,input().split())\nA = list(map(int,input().split()))\n\ns = sum(A)\nif s > N:\n print(-1)\nelse:\n print(N-s)', 'N,M = map(int,input().split())\nA = list(map(int,input().split()))\n\ns = sum(A)\nif s > N:\n print(-1)\nelse:\n print(N-s)']
['Wrong Answer', 'Accepted']
['s946948718', 's726170152']
[10120.0, 9880.0]
[22.0, 24.0]
[122, 122]
p02706
u535649420
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.
["input_line = input().split(' ')\ndays = input_line[0]\nassignments = input_line[1]\n\ninput_assign = input().split(' ')\n\nhow_many_days = sum(input_assign)\n\nlen = days - how_many_days\nif len < 0:\n print(-1)\nelse:\n print(len)", "input_line = int(input())\nans = [0] * input_line\n\ninputs = input().split(' ')\ninputs = list(map(int, inputs))\nfor e in inputs:\n for i in range(1, input_line):\n if e == i:\n ans[i] += 1\n\nfor i in range(len(ans)):\n print(ans[i])", "input_line = input().split(' ')\ninput_line = list(map(int, input_line))\ninput_assign = input().split(' ')\ninput_assign = list(map(int, input_assign))\n\nlen = input_line[0] - sum(input_assign)\nif len < 0:\n print(-1)\nelse:\n print(len)"]
['Runtime Error', 'Runtime Error', 'Accepted']
['s448158756', 's645331819', 's719671770']
[9340.0, 9140.0, 9876.0]
[22.0, 23.0, 23.0]
[221, 235, 233]
p02706
u536034761
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())\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()))\nif sum(A) > N:\n print(-1)\nelse:\n print(N - sum(A))']
['Wrong Answer', 'Accepted']
['s995542685', 's487485840']
[9520.0, 10204.0]
[23.0, 22.0]
[115, 121]
p02706
u538909258
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 = list(int(input()))\nans = list(int(input()))\nnum = 0\nfor i in range(0, len(ans)):\n num += ans[i]\n\ntarget = day[0] - num\n\nif target >= 0:\n print(target)\nelse:\n print("-1")', 'n, m = map(int, input().split())\na = list(map(int, input().split()))\n\nnum = 0\nfor i in range(0, len(a)):\n num += int(a[i])\n\nprint(num)\n\ntarget = n - num\n\nif target >= 0:\n print(target)\nelse:\n print("-1")', 'n, m = map(int, input().split())\na = list(map(int, input().split()))\n\nnum = 0\nfor i in range(0, len(a)):\n num += int(a[i])\n\ntarget = n - num\n\nif target >= 0:\n print(target)\nelse:\n print("-1")']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s154392629', 's626939529', 's448512519']
[9184.0, 10056.0, 10060.0]
[22.0, 22.0, 22.0]
[184, 212, 200]
p02706
u539517139
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(max(-1,n-sum(a)))', 'n,m=map(int(input().split()))\nprint(max(-1,n-sum(list(map(int,input().split())))))', 'n,m=map(int,input().split())\nprint(max(-1,n-sum(list(map(int,input().split())))))']
['Runtime Error', 'Runtime Error', 'Accepted']
['s551115619', 's819085694', 's916808780']
[9048.0, 9040.0, 9880.0]
[25.0, 22.0, 19.0]
[86, 82, 81]
p02706
u540912766
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 = 0\n\nfor i in range(M):\n A_sum += int(input())\n\nif (N - A_sum) > 0:\n print(N - A_sum)\nelse:\n print("-1")', 'N, M = map(int, input().split())\nA = list(map(int,input().split()))\nsum = 0\n\nfor i in range(M):\n sum += A[i]\n\nif (N - sum) >= 0:\n print(N - sum)\nelse:\n print("-1")']
['Runtime Error', 'Accepted']
['s654077812', 's685956807']
[9204.0, 10060.0]
[24.0, 30.0]
[152, 172]
p02706
u546132222
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\n\n\n\n\n\n\n\n\n\nn = int(input())\nm = int(input())\na = list(map(int, input().split()))\n\n\nanswer = n - sum(a)\n\nif answer > 0:\n print(answer)\nelse:\n print("-1")\n', '# abc163B\n\n\n\n\n\n\n\n\n\nn, m = map(int, input().split())\na = list(map(int, input().split()))\n\n\n\nanswer = n - sum(a)\n\nif answer < 0:\n print("-1")\nelse:\n print(answer)\n']
['Runtime Error', 'Accepted']
['s871946506', 's230152948']
[9040.0, 9964.0]
[27.0, 32.0]
[469, 501]
p02706
u546338822
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 main():\n n,m = map(int,input().split())\n a = list(map(int,input().split()))\n s = sum(a)\n if s<n:\n print(\'-1\')\n else:\n print(n-s)\n\n\nif __name__ == "__main__":\n main()', 'def main():\n n,m = map(int,input().split())\n a = list(map(int,input().split()))\n s = sum(a)\n if s>n:\n print(\'-1\')\n else:\n print(n-s)\n\n\nif __name__ == "__main__":\n main()']
['Wrong Answer', 'Accepted']
['s019571596', 's908346209']
[9992.0, 10036.0]
[23.0, 21.0]
[201, 201]
p02706
u547608423
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\nhomework=0\n\nfor a in A:\n homework+=a\n\nif N>hemework:\n print(N-homework)\nelse:\n print(-1)', 'N,M=map(int,input().split())\nA=list(map(int,input().split()))\n\nhomework=0\n\nfor a in A:\n homework+=a\n\nif N>=homework:\n print(N-homework)\nelse:\n print(-1)']
['Runtime Error', 'Accepted']
['s700577917', 's153717983']
[10012.0, 9880.0]
[23.0, 23.0]
[160, 161]
p02706
u548545174
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 _ in range(M)]\n\ndays = sum(A)\n\nif days <= N:\n print(N-days)\nelse:\n print(-1)', 'N, M = map(int, input().split())\nA = list(map(int, input().split()))\n \ndays = sum(A)\n \nif days <= N:\n print(N-days)\nelse:\n print(-1)']
['Runtime Error', 'Accepted']
['s270518383', 's642849907']
[9244.0, 9880.0]
[21.0, 24.0]
[137, 138]
p02706
u549494450
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().split(" ")\nb = input().split(" ")\nc = 0\nfor i in b:\n c += int(i)\nif a >= c:\n print(a - c)\nelse:\n print(-1)', 'a = input().split(" ")\nb = input().split(" ")\nc = 0\nfor i in b:\n c += int(i)\nif int(a[0]) >= c:\n print(int(a[0]) - c)\nelse:\n print(-1)\n']
['Runtime Error', 'Accepted']
['s408277559', 's773499570']
[9580.0, 9412.0]
[23.0, 21.0]
[127, 144]
p02706
u550257207
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())\nl = list(map(int,input().split()))\ns = sum(l)\nif n-s<0:\n print(-1)\nelse:\n print(n-s)', 'n,m = map(int,input().split())\nl = list(map(int,input().split()))\ns = sum(l)\nif n-s<0:\n print(-1)\nelse:\n print(n-s)']
['Runtime Error', 'Accepted']
['s450546562', 's324907633']
[9184.0, 9888.0]
[19.0, 24.0]
[109, 117]
p02706
u554760428
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 = 0\nfor i in m:\n sum += A[i]\n\nans = n - sum\nif ans >= 0:\n print(ans)\nelse:\n print(-1)', 'n, m = map(int, input().split())\nA = list(map(int, input().split()))\n\nsum = 0\nfor i in range(m):\n sum += A[i]\n\nans = n - sum\nif ans >= 0:\n print(ans)\nelse:\n print(-1)\n']
['Runtime Error', 'Accepted']
['s987370375', 's147491364']
[10056.0, 9880.0]
[24.0, 22.0]
[162, 170]
p02706
u558717347
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.
['mn = input().split()\nmn = [int(x) for x in mn]\nn = mn[0]\nm = mn[1]\na = input().split()\na = [int(x) for x in a]\n\n\ntotal = sum(a)\nif n-total <0:\n print(-1)\nelse:\n prtin(n-total)', "mn = input().split()\nmn = [int(x) for x in mn]\nn = mn[0]\nm = mn[1]\na = input().split()\na = [int(x) for x in a]\n\n\ntotal = sum(a)\nif n-total <0:\n print('-1')\nelse:\n prtin(n-total)", "mn = input().split()\nmn = [int(x) for x in mn]\nn = mn[0]\nm = mn[1]\na = input().split()\na = [int(x) for x in a]\n\n\ntotal = sum(a)\nif n-total <0:\n print('-1')\nelse:\n print(n-total)"]
['Runtime Error', 'Runtime Error', 'Accepted']
['s237658914', 's349719526', 's147423789']
[9880.0, 10040.0, 9884.0]
[23.0, 25.0, 23.0]
[182, 184, 184]
p02706
u558764629
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\nsum = 0\n\nfor i in range(1,M+1):\n sum += int(input())\n\nif(N >= sum):\n print(N - sum)\nelse:\n print(-1)', 'N,M = map(int, input().split())\n\na = [int(input()) for i in range(M)]\n\nif(N >= sum(a)):\n print(N - sum(a))\nelse:\n print(-1)', 'N,M = map(int, input().split())\n\na = [int(M) for M in input().split()]\n\nif(N >= sum(a)):\n print(N - sum(a))\nelse:\n print(-1)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s099924128', 's688438600', 's178002988']
[9188.0, 9120.0, 10020.0]
[22.0, 19.0, 23.0]
[144, 129, 130]
p02706
u561691391
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())\nprint(max(n - sum(list(map(int, input().split())))), -1)\n', "n, m = map(int, input().split())\nA = list(map(int,input().split()))\n\nif n >= sum(A):\n print(n - sum(A))\nelse:\n print('-1')\n"]
['Runtime Error', 'Accepted']
['s791039988', 's106272909']
[10036.0, 9860.0]
[23.0, 22.0]
[90, 129]
p02706
u561859676
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\ndef getIntList():\n return list(map(int, input().split()))\n\ndef main():\n \n N,M = map(int,input().split())\n A = getIntList()\n\n for i in range(M):\n N += A[i]\n \n if N >= 0:\n print(N)\n else:\n print(-1)\n\n return\n\nif __name__ == "__main__":\n main()', '\n\ndef getIntList():\n return list(map(int, input().split()))\n\ndef main():\n \n N,M = map(int,input().split())\n A = getIntList()\n\n for i in range(M):\n N -= A[i]\n \n if N >= 0:\n print(N)\n else:\n print(-1)\n\n return\n\nif __name__ == "__main__":\n main()']
['Wrong Answer', 'Accepted']
['s587442907', 's879701169']
[9884.0, 10192.0]
[25.0, 25.0]
[294, 294]
p02706
u563711100
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().split()\nm = input().split()\nn = [int(i) for i in n]\nm = [int(i) for i in m]\n\nfor i in m:\n n[0]=n[0]-i\n if n[0]<0:\n print("-1")\n else:\n print(n[0])', 'n = input().split()\nm = input().split()\nn = [int(i) for i in n]\nm = [int(i) for i in m]\na = n[0]\nfor i in m:\n a -= i\n if a<0:\n print("-1")\n else:\n print(a)', 'n = input().split()\nm = input().split()\nn = [int(i) for i in n]\nm = [int(i) for i in m]\na = n[0]\nfor i in m:\n a -= i\n \nif a<0:\n print("-1")\nelse:\n print(a)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s273345817', 's630107132', 's161880042']
[10184.0, 9880.0, 9876.0]
[31.0, 27.0, 25.0]
[167, 164, 159]
p02706
u565436116
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.
['NM = [int(i) for i in input().split()]\nA = [int(i) for i in input().split()]\n\nN = NM[0]\nM = NM[1]\n\nif NM >= sum(A):\n print(NM-sum(A))\nelse:\n print(-1)\n', 'NM = [int(i) for i in input().split(" ")]\nA = [int(i) for i in input().split(" ")]\n\nN = NM[0]\nM = NM[1]\n\nif NM => sum(A):\n print(NM-sum(A))\nelse:\n print(-1)\n', 'NM = [int(i) for i in input().split()]\nA = [int(i) fot i in input().split()]\n\nN = NM[0]\nM = NM[1]\n\nif NM => sum(A):\n print(NM-sum(A))\nelse:\n print(-1)\n', 'NM = [int(i) for i in input().split()]\nA = [int(i) for i in input().split()]\n\nN = NM[0]\nM = NM[1]\n\nif NM => sum(A):\n print(NM-sum(A))\nelse:\n print(-1)\n', 'NM = [int(i) for i in input().split(" ")]\nA = [int(i) fot i in input().split(" ")]\n\nN = NM[0]\nM = NM[1]\n\nif NM => sum(A):\n print(NM-sum(A))\nelse:\n print(-1)', 'NM = [int(i) for i in input().split()]\nA = [int(i) for i in input().split()]\n\nN = NM[0]\nM = NM[1]\n\nif N >= sum(A):\n print(N-sum(A))\nelse:\n print(-1)\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s303848461', 's375658658', 's525529457', 's900917267', 's915040099', 's803355751']
[9880.0, 8968.0, 9020.0, 8964.0, 9016.0, 10116.0]
[22.0, 24.0, 20.0, 20.0, 20.0, 22.0]
[153, 159, 153, 153, 158, 151]
p02706
u565448206
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 x=list(map(int,input().split(" ")))\n y = list(map(int, input().split(" ")))\n num=0\n for i in y:\n num+=i\n if x[0]<y:\n print(-1)\n else: print(x[0]-y)', 'if __name__ == \'__main__\':\n x=list(map(int,input().split(" ")))\n y = list(map(int, input().split(" ")))\n num=0\n for i in y:\n num+=i\n if x[0]<num:\n print(-1)\n else: print(x[0]-num)']
['Runtime Error', 'Accepted']
['s847226942', 's715727623']
[9880.0, 10004.0]
[22.0, 23.0]
[207, 211]
p02706
u566968132
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.
['l=[list(map(int,input().split())) for _ in range(2)]\nhomework=0\nfor i in range(l[0][1]):\n homework=homework+l[1][i]\nprint(homework)\nfree=l[0][0]-homework\nif free<0:\n print(-1)\nelse:\n print(free)', 'l=list(map(int,input().split()))\nhomework=0\nfor i in range(l[1]):\n homework=homework+l[i+2]\nfree=l[0]-homework\nif free<0:\n print(-1)\nelse:\n print(free)', 'l=[list(map(int,input().split())) for _ in range(2)]\nhomework=0\nfor i in range(l[0][1]):\n homework=homework+l[1][i]\nfree=l[0][0]-homework\nif free<0:\n print(-1)\nelse:\n print(free)']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s567864853', 's826518506', 's892394250']
[9888.0, 9168.0, 10188.0]
[24.0, 20.0, 26.0]
[203, 160, 187]
p02706
u568576853
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()))\ns=0\nfor i in a:\n s+=i\nif s>a:\n print(-1)\nelse:\n print(a-s)', 'n,m=map(int,input().split())\na=list(map(int,input().split()))\ns=0\nfor i in a:\n s+=i\nif s>n:\n print(-1)\nelse:\n print(n-s)']
['Runtime Error', 'Accepted']
['s341226531', 's814874250']
[10060.0, 10056.0]
[22.0, 22.0]
[129, 129]
p02706
u569272329
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 >= M:\n print(A-M)\nelse:\n print(-1)\n', 'N, M = map(int, input().split())\nA = sum(list(map(int, input().split())))\nif N >= A:\n print(N-A)\nelse:\n print(-1)\n']
['Wrong Answer', 'Accepted']
['s549815232', 's576921217']
[10044.0, 9952.0]
[22.0, 21.0]
[120, 120]
p02706
u571941361
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()))\ns = sum(a)\nif n < s:\n print(-1)\nelse:\n print(n - a)', 'n, m = map(int, input().split())\na = list(map(int, input().split()))\ns = sum(a)\nif n < s:\n print(-1)\nelse:\n print(n - s)']
['Runtime Error', 'Accepted']
['s980120245', 's935982310']
[9180.0, 9880.0]
[24.0, 24.0]
[120, 122]
p02706
u574565611
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 = list(map(int, input.split()))\n\navail = N - sum(A_list)\n\nif avail >= 0: \n print(avail)\n \nelse:\n print(-1)', 'N,M = map(int, input().split())\nA_list = list(map(int, input().split()))\n \navail = N - sum(A_list)\n \nif avail >= 0: \n print(avail)\n \nelse:\n print(-1)']
['Runtime Error', 'Accepted']
['s560553157', 's534761273']
[9136.0, 10052.0]
[20.0, 23.0]
[149, 153]
p02706
u581187895
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.
['\ndef resolve():\n N, K = map(int, input().split())\n A = list(map(int, input().split()))\n print(N - sum(A))\n\nif __name__ == "__main__":\n resolve', '\ndef resolve():\n N, K = map(int, input().split())\n A = list(map(int, input().split()))\n ans = N - sum(A)\n if ans < 0:\n print(-1)\n else:\n print(ans)\n\n\nif __name__ == "__main__":\n resolve()']
['Wrong Answer', 'Accepted']
['s331732006', 's982440981']
[9040.0, 9892.0]
[19.0, 22.0]
[154, 219]