Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n,x = map(int,input().split())
A = sorted(map(int,input().split()))
ans = 0
for i in range(n):
  x -= A[i]
  ans += 1
  if x = 0:
    ans -= 1
    break
print(ans)


Fixed submission:
n,x = map(int,input().split())
a = sorted(list(map(int,input().split())))
for i in range(n):
  x = x-a[i]
  if x<0:
    break
if i == n-1 and x == 0:
  i += 1
print(i)
Buggy python submission (verdict: Runtime Error):
x1,y1,x2,y2 = map(int,input().split())
l = abs(y2 - y1)
x3 = x1 - l
y3 = y2
x4 = x3
y4 = y1
print(x3,y3.x4.y4)

Fixed submission:
x_1,y_1,x_2,y_2 = map(int,input().split())
print(y_1+x_2-y_2,-x_1+x_2+y_2,x_1+y_1-y_2,-x_1+y_1+x_2)
Buggy python submission (verdict: Runtime Error):
n,i = (int,input().split())
print(n-i+1)

Fixed submission:
n,i = map(int,input().split())
print(n-i+1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = 0
A = [i for i in range(n+1)]
A = A[1::2]
for i in range(len(A)):
    a=0
    for j in range(len(A)):
        if A[i] % j == 0:
            a += 1
    if a == 8:
        ans += 1
print(ans)


Fixed submission:
n = int(input())
ans=0
for i in range(1,n+1,2):
    a=0
    for j in range(1,i+1,2):
        if i%j==0:
            a+=1
    if a==8:
        ans+=1
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
A = [i for i in range(n)]
A = A[1::2]
ans = 0
for i in range(len(A)):
  a = 0
  for j in range(len(A)//2):
    if A[i] % j == 0:
      a += 1
      if a == 8:
        ans += 1
      if a == 9:
        ans -= 1
        break
print(ans)

Fixed submission:
n = int(input())
ans=0
for i in range(1,n+1,2):
    a=0
    for j in range(1,i+1,2):
        if i%j==0:
            a+=1
    if a==8:
        ans+=1
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
ans=0
for i in range(1,N+1,2):
    a=0
    for j in range(1,i+1,2):
        if i%j==0:
            a+=1
    if a==8:
        ans+=1
print(ans)


Fixed submission:
n = int(input())
ans=0
for i in range(1,n+1,2):
    a=0
    for j in range(1,i+1,2):
        if i%j==0:
            a+=1
    if a==8:
        ans+=1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
N, M, Q = map(int, input().split())
P = []
LR = [[0] * (N+1) for _ in range(N+1)] 
for m in range(M):
    l, r = map(int, input().split())
    LR[l][r] += 1

for q in range(Q):
    p = list(map(int, input().split()))
    P.append(p)

csum = []
for L in LR:
    a = list(itertools.accumulate(L))
    csum.append(a)

for p in P:
    ans = 0
    l, r = p
    for c in csum[l:r+1]:
        ans += (c[r] - c[l-1])
    print (ans)

Fixed submission:
import itertools
N, M, Q = map(int, input().split())
P = []
LR = [[0] * (N+1) for _ in range(N+1)] 
for m in range(M):
    l, r = map(int, input().split())
    LR[l][r] += 1

for q in range(Q):
    p = list(map(int, input().split()))
    P.append(p)

csum = []
for L in LR:
    a = list(itertools.accumulate(L))
    csum.append(a)

for p in P:
    ans = 0
    l, r = p
    for c in csum[l:r+1]:
        ans += (c[r] - c[l-1])
    print (ans)
Buggy python submission (verdict: Runtime Error):
a,b = map(ont,input().split())
if a % b == 0:
  print(0)
else:
  print(1)

Fixed submission:
a,b = map(int,input().split())
if a % b == 0:
  print(0)
else:
  print(1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = n//4
b = n//7
ans = 0
for i in range(a+1):
    for j in range(b+1):
        if 4*i+7*j == n:
            ans = 1
if ans = 1:
  print('Yes')
else:
  print('No')        


Fixed submission:
x=int(input())
t=0
while x>=0:
  if x%7==0:
    t=1
  x-=4
if t==0:
  print('No')
else: print('Yes')

Buggy python submission (verdict: Runtime Error):
n = int(input())
for i in range():
  for j in range():
    if 3*(i+1)+7*(j+1) == n:
      print('Yes')
    else:
      print('No')


Fixed submission:
x=int(input())
t=0
while x>=0:
  if x%7==0:
    t=1
  x-=4
if t==0:
  print('No')
else: print('Yes')
Buggy python submission (verdict: Runtime Error):
n=int(input())
x=""
While n != 0:
    x = str(n%2) + x
    n = -(n//2)
print(0 if x == "" else x)


Fixed submission:
n=int(input())
x=""
while n != 0:
    x = str(n%2) + x
    n = -(n//2)
print(0 if x == "" else x)

Buggy python submission (verdict: Runtime Error):
n = int(input())
x = ''
While n != 0:
  x += str(n%2)
  n = -(n//2)
  
if x == '':
  print(0)
else:
  print(x)

Fixed submission:
n=int(input())
x=""
while n != 0:
    x = str(n%2) + x
    n = -(n//2)
print(0 if x == "" else x)
Buggy python submission (verdict: Runtime Error):
L = list[map(int,input().split())]
M = L.sort()
print(L[2]-L[0])

Fixed submission:
l=sorted(map(int,input().split()))
print(l[-1]-l[0])
Buggy python submission (verdict: Runtime Error):
s = input()
w = int(input())
ans = []
asn.append(s[0])
for i in range(1,w//3+1):
  ans.append(s[w*i+1])
print(ans)
  

Fixed submission:
s=input()
n = int(input())
print(s[::n])
Buggy python submission (verdict: Runtime Error):
n = int(input())
sum_a = 0
for i in range(n):
  a = n[i]
  sum_a += a
if n % sum_a == 0:
  print('Yes')
else:
  print('No')


Fixed submission:
N = input()
ans = 0
for i in N:
    ans += int(i)
if int(N)%ans == 0:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
n = int(input())
l = []
for i in range(n):
  a = n[i]
  sum_a += a
if n % sum_a == 0:
  print('Yes')
else:
  print('No')


Fixed submission:
N = input()
ans = 0
for i in N:
    ans += int(i)
if int(N)%ans == 0:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
n = str(input())
l = []
for i in range(n):
  a = n[i]
  l.append(a)
sum_l = sum(l)
if int(n) % sum_l == 0:
  print('Yes')
else:
  print('No')

Fixed submission:
N = input()
ans = 0
for i in N:
    ans += int(i)
if int(N)%ans == 0:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
n = str(input())
l = []
for i in range():
  a = n[i]
  l.append(a)
sum_l = sum(l)
if int(n) % sum_l == 0:
  print('Yes')
else:
  print('No')

Fixed submission:
N = input()
ans = 0
for i in N:
    ans += int(i)
if int(N)%ans == 0:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
L = list(map(int,input().split()))
L = sorted(L)
S = []
if N >= M:
  print(0)
  exit()

for i in range(M-1):
  S.append(abs(L[i+1]-L[i]))

  S=sorted(S)
print(sum(S[0:M-N]))



Fixed submission:
N = int(input())
a = list(map(int, input().split()))
ans = 0

for i in a:
    while True:
        if i % 2 == 0:
            ans += 1
            i //= 2
        else:
            break
print(ans)

Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
L = list(map(int,input().split()))
L = sorted(L)
S = []
if N >= M:
	print(0)
	exit()

for i in range(M-1):
	S.append(abs(L[i+1]-L[i]))
S=sorted(S)
print(sum(S[0:M-N]))



Fixed submission:
N = int(input())
a = list(map(int, input().split()))
ans = 0

for i in a:
    while True:
        if i % 2 == 0:
            ans += 1
            i //= 2
        else:
            break
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
if n >= 1000:
  print('ABD'+(n-999))
else:
  print('ABC'+n)

Fixed submission:
n = int(input())
if n >= 1000:
  print('ABD')
else:
  print('ABC')

Buggy python submission (verdict: Runtime Error):
n = int(input())
if n >= 1000:
  print('ABD'+(1000-n))
else:
  print('ABC'+n)

Fixed submission:
n = int(input())
if n >= 1000:
  print('ABD')
else:
  print('ABC')
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
n =　b-a
print(n*(n+1)/2-b)


Fixed submission:
a,b = map(int,input().split())
n = b-a
tower = ((n+1)*n)/2
print(int(tower-b))

Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
n =　b-a
print(n*(n+1)//2-b)


Fixed submission:
a,b = map(int,input().split())
n = b-a
tower = ((n+1)*n)/2
print(int(tower-b))

Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
for i in range (1,1000):
  n = i(i+1)//2
  if b - a == i:
    print(n-a)
  

Fixed submission:
a,b = map(int,input().split())
n = b-a
tower = ((n+1)*n)/2
print(int(tower-b))
Buggy python submission (verdict: Runtime Error):
n = int(input())

arr6 = []
for i in range(10):
	arr6.append(6**i)

arr9 = []
for i in range(10):
	arr9.append(9**i)


ans = float("inf")
for i in range(n+1):
	count = 0
	tmp = i
	while tmp > 0:
		t = 0
		while arr6[t] <= tmp:
			t+=1

		tmp -= arr6[t-1]
		count += 1

	tmp = n-i
	while tmp > 0:
		t = 0
		while arr9[t] <= tmp:
			t += 1
		tmp -= arr9[t-1]
		count += 1

	ans = min(ans,count)

print ans


Fixed submission:
import numpy as np
N = int(input())

coin = [6**n for n in range(10) if 6**n <= N]
coin += [9**n for n in range(10) if 9**n <= N]

dp = np.zeros(N+1, dtype=np.int32)
dp += 10**9
dp[0] = 0

for c in coin:
  for _ in range(9):
    dp[c:] = np.minimum(dp[:-c] + 1, dp[c:])

answer = dp[-1]
print(answer)
Buggy python submission (verdict: Runtime Error):
n = int(input())
if n % 10 == 0:
  print(10)
else:
  a = str(n)
  b = sum(a)
  print(b)

Fixed submission:
n = int(input())
if n % 10 == 0:
  print(10)
else:
  result = sum(list(map(int, str(n))))
  print(result)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,c,k = map(int,input().split())
for i in range(k):
  a,b,c = b+c,c+a,a+b
  
Ans = a-b
if abs(Ans) > 10^18:
  print('Unfair')
else:
  print(Ans)

Fixed submission:
a, b, c, k = map(int, input().split())

if k % 2 == 0:
    print(a - b)
else:
    print(b - a)
Buggy python submission (verdict: Runtime Error):
x = int(input)
for i in range(x**0.5):
  if x <= i**2:
    break
    print((i-1)**2)

Fixed submission:
X = int(input())
se = set(n**e for n in range(32) for e in range(2,11) if n**e <= X)

answer = max(se)
print(answer)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,ibput().split())
if a >= b:
  print(b)
else:
  print(a)

Fixed submission:
a,b = map(int,input().split())
if a <= b:
  print(a)
else:
  print(a-1)
Buggy python submission (verdict: Runtime Error):
l = list(map(int,input().split()))
k = int(input())
L =l.sorted()
print(l[0]+l[1]+l[2]*(k*2))


Fixed submission:
a,b,c = map(int,input().split())
k = int(input())
print(a+b+c-max(a,b,c)+max(a,b,c)*(2 ** k))

Buggy python submission (verdict: Runtime Error):
l = list(map(int,input().split()))
k = int(input())
L =l.sorted()
print(int(l[0])+int(l[1])+int(l[2])*k)

Fixed submission:
a,b,c = map(int,input().split())
k = int(input())
print(a+b+c-max(a,b,c)+max(a,b,c)*(2 ** k))

Buggy python submission (verdict: Runtime Error):
l = list(map(int,input().split()))
k = int(input())
L =l.sorted()
print(l[0]+l[1]+l[2]*k)

Fixed submission:
a,b,c = map(int,input().split())
k = int(input())
print(a+b+c-max(a,b,c)+max(a,b,c)*(2 ** k))
Buggy python submission (verdict: Runtime Error):
n,x = map(int,input().split())
l = []
for i in range(n):
  l.append(int(input())
sum_l = sum(l)
mini = min(l)
rest = x - sum_l
count = n + rest//mini
print(count)

Fixed submission:
n,x = map(int,input().split())
l = []
for i in range(n):
  l.append(int(input()))
sum_l = sum(l)
mini = min(l)
rest = x - sum_l
count = n + rest//mini
print(count)
Buggy python submission (verdict: Runtime Error):
A,B,C,X,Y = map(int,input().split())

ans = 10**18
for c in range(10**5+1):
  a = X-c
  b = Y-c
  cost = C*c*2
  cost += max(a,0)*A
  cost += max(b,0)*B
  ans = min(ans,cost)
print(answer)

Fixed submission:
A,B,C_AB,X,Y = map(int, input().split())
if A+B >= 2*C_AB:
  print(2*C_AB*(min(X,Y)) + min(A,2*C_AB)*(X-min(X,Y)) + min(B,2*C_AB)*(Y-min(X,Y)))
else:
  print(A*X+ B*Y)

Buggy python submission (verdict: Time Limit Exceeded):
a,b,c,x,y = map(int,input().split())
A_B = a*x+b*y
AB = 2*c*max(x,y)
A_AB = 10**11111111
AB_B = 10**11111111
if x-y > 0:
  A_AB = a*(x-y)+2*c*y
if y-x > 0:
  AB_B = 2*c*x+b*(y-x)

ans = min(A_B,A_AB,AB_B,AB)
print(ans)


Fixed submission:
A,B,C_AB,X,Y = map(int, input().split())
if A+B >= 2*C_AB:
  print(2*C_AB*(min(X,Y)) + min(A,2*C_AB)*(X-min(X,Y)) + min(B,2*C_AB)*(Y-min(X,Y)))
else:
  print(A*X+ B*Y)
Buggy python submission (verdict: Runtime Error):
s = list(input())
if s[0] != a[1] and s[1] != s[2] and s[2] != s[0]:
  print('Yes')
else:
  print('No')

Fixed submission:
s = str(input())
a = s.count('a')
b = s.count('b')
c = s.count('c')
if a == b == c == 1:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
s = str(input())
a = s.count(a)
b = s.count(b)
c = s.count(c)
if a == b == c == 1:
  print('Yes')
else:
  print('No')

Fixed submission:
s = str(input())
a = s.count('a')
b = s.count('b')
c = s.count('c')
if a == b == c == 1:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
l =list[a:b]
mimi = l[:a-k]
maxi = l[b-k:]
print(mini+maxi)


Fixed submission:
a,b,k=map(int,input().split())
l=range(a,b+1)
ans=sorted(set(l[:k])|set(l[-k:]))
for i in ans:
    print(i)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
L = list[a,b,c,d]
M = L.sort()
print(M[0]+M[1])

Fixed submission:
a,b,c,d=[int(input()) for i in range(4)]
print(min(a,b)+min(c,d))
Buggy python submission (verdict: Runtime Error):
n = int(input())
d,x = map(int,input().split())

a = []
for i in range(n):
  a.append(int(input()))

count = 0
for i in range(1,d+1):
  for j in a:
    if (i-1)%a == 0:
      count += 1

print(count + n)



Fixed submission:
n = int(input())
m, k = [int(_) for _ in input().split()]
    
for i in range(n):
    for j in range(1, m+1, int(input())):
        k += 1
print(k)

Buggy python submission (verdict: Runtime Error):
n = int(input())
d,x = map(int,input().split())
count += x
a = []
for i in range(n):
  b = int(input())
  a.append(b)
  for j in range(n):
    if 1 + a[i]*j <= n:
      count += 1
print(count)

Fixed submission:
n = int(input())
m, k = [int(_) for _ in input().split()]
    
for i in range(n):
    for j in range(1, m+1, int(input())):
        k += 1
print(k)

Buggy python submission (verdict: Runtime Error):
n = int(input())
d,x = map(int,input(),split())
count += x
a = []
for i in range(n):
  b = int(input())
  a.append(b)
  for j in range(n):
    if 1 + a[i]*j <= n:
      count += 1
print(count)

Fixed submission:
n = int(input())
m, k = [int(_) for _ in input().split()]
    
for i in range(n):
    for j in range(1, m+1, int(input())):
        k += 1
print(k)

Buggy python submission (verdict: Runtime Error):
n = int(input())
d,x = map(int,input(),split())
count += x
a = []
for i in range(n):
  a.append(int(input()))
  for j in range(n):
    if 1 + a[i]*j <= n:
      count += 1
print(count)

Fixed submission:
n = int(input())
m, k = [int(_) for _ in input().split()]
    
for i in range(n):
    for j in range(1, m+1, int(input())):
        k += 1
print(k)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input(),split())
if a+b >= c:
  print('Yes')
else:
  print('No')

Fixed submission:
a,b,c = map(int,input().split())
if a+b >= c:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = list(map(str,input().split()))
if s in 'Y':
  print('Four')
else:
  print('Three')

Fixed submission:
n = int(input())
s = map(str,input().split())
if 'Y' in s:
  print('Four')
else:
  print('Three')

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = map(str,input().split())
if s in 'Y':
  print('Four')
else:
  print('Three')

Fixed submission:
n = int(input())
s = map(str,input().split())
if 'Y' in s:
  print('Four')
else:
  print('Three')
Buggy python submission (verdict: Runtime Error):
n = input()
n = list(n)
#5行目のエラーを防ぐためにstrからlistに変換
if n[-2] != '9' and n[-1] != '9':
  n[-2] = '9'
  n[-1] = str(int(n[-1])+1)

N = [int(i) for i in n]
#listをstrからintに変換
print(sum(N))



Fixed submission:
N = list(map(str, input().rstrip()))
print(max(sum([int(i) for i in N]), 9*(len(N)-1)+int(N[0])-1))

Buggy python submission (verdict: Runtime Error):
n = input()

if n[-2] != '9' and n[-1] != '9':
  n[-2] = '9'
  n[-1] = str(int(n[-1])+1)

print(sum(n))

Fixed submission:
N = list(map(str, input().rstrip()))
print(max(sum([int(i) for i in N]), 9*(len(N)-1)+int(N[0])-1))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = int(input())
m = n % 500
if a >=　m :
  print('Yes')
else:
  print('No')


Fixed submission:
n=int(input())%500
a=int(input())
print('Yes' if a>=n else 'No')

Buggy python submission (verdict: Runtime Error):
n=int(input())%500
a=int(input())
if a>=n:
  print('Yes')
else:
  ptint('No')


Fixed submission:
n=int(input())%500
a=int(input())
print('Yes' if a>=n else 'No')

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = int(input())
if a >=　(n % 500):
  print('Yes')
else:
  print('No')

Fixed submission:
n=int(input())%500
a=int(input())
print('Yes' if a>=n else 'No')

Buggy python submission (verdict: Runtime Error):
a = int(input())
n = int(input())
if a >=　(n % 500):
  print('Yes')
else:
  print('No')

Fixed submission:
n=int(input())%500
a=int(input())
print('Yes' if a>=n else 'No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = list(map(int,input().split()))
S = s.sort(reverse=True)

A = S[0:n+1:2]
B = S[1:n+1:2]




Fixed submission:
N = int(input())
a = list(map(int,input().split()))
b = sorted(a, reverse=True) 
Alice = 0
Bob = 0

for i in range(N):
  if i % 2 == 0:
    Alice += b[i]
  else:
    Bob += b[i]
    
print(Alice - Bob)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = list(map(int,input().split()))
S = s.sort(reverse=True)
A = S[0:n+1:2]
B = S[1:n+1:2]
sum_A = sum(A)
sum_B = sum(B)
print(sum_A - sum_B)




Fixed submission:
N = int(input())
a = list(map(int,input().split()))
b = sorted(a, reverse=True) 
Alice = 0
Bob = 0

for i in range(N):
  if i % 2 == 0:
    Alice += b[i]
  else:
    Bob += b[i]
    
print(Alice - Bob)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = list(map(int,input().split()))
S = s.sort(reverse=True)
A = S[0:n+1:2]
B = S[1:n+1:2]
sum_A = sum(A)
sum_B = sum(B)
print(sum_A - sum_B)




Fixed submission:
N = int(input())
a = list(map(int,input().split()))
b = sorted(a, reverse=True) 
Alice = 0
Bob = 0

for i in range(N):
  if i % 2 == 0:
    Alice += b[i]
  else:
    Bob += b[i]
    
print(Alice - Bob)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = list(map(int,input().split()))
S = s.sort()
S_re = S.reverse()
A = S_re[0:n+1:2]
B = S_re[1:n+1:2]
sum_A = sum(A)
sum_B = sum(B)
print(sum_A - sum_B)




Fixed submission:
N = int(input())
a = list(map(int,input().split()))
b = sorted(a, reverse=True) 
Alice = 0
Bob = 0

for i in range(N):
  if i % 2 == 0:
    Alice += b[i]
  else:
    Bob += b[i]
    
print(Alice - Bob)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = list(map(int,input().split()))
S = s.sort(Reverse=True)
A = S[0:n+1:2]
B = S[1:n+1:2]
sum_A = sum(A)
sum_B = sum(B)
print(sum_A - sum_B)




Fixed submission:
N = int(input())
a = list(map(int,input().split()))
b = sorted(a, reverse=True) 
Alice = 0
Bob = 0

for i in range(N):
  if i % 2 == 0:
    Alice += b[i]
  else:
    Bob += b[i]
    
print(Alice - Bob)
Buggy python submission (verdict: Runtime Error):
a,b,c,x = map(int,input().split())
ans = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if 500*a + 100*b + 50*c == x:
                ans += 1
print(ans)




  

Fixed submission:
a, b, c, x = map(int, [input() for i in range(4)])
ans = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if i * 500 + j * 100 + k * 50 == x:
                ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
a,b,c,x = int(input().split())
ans = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if 500*a + 100*b + 50*c == x:
                ans += 1
print(ans)




  

Fixed submission:
a, b, c, x = map(int, [input() for i in range(4)])
ans = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if i * 500 + j * 100 + k * 50 == x:
                ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
a,b,c,x = map(int,input().split())
count = 0

for a in range(a+1):
    for b in range(b+1):
        for c in range(c+1):
            if (500*a + 100*b + 50*c) == x:
                count += 1

print(count)


Fixed submission:
a, b, c, x = map(int, [input() for i in range(4)])
ans = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if i * 500 + j * 100 + k * 50 == x:
                ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
a,b,c,x = map(int,input().split())
count = 0

for a in range(a+1):
    for b in range(b+1):
        for c in range(c+1):
            if (500*a + 100*b + 50*c) == x:
                count += 1




Fixed submission:
a, b, c, x = map(int, [input() for i in range(4)])
ans = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if i * 500 + j * 100 + k * 50 == x:
                ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
x = int(input())
count = 0

for a in range(a+1):
    for b in range(b+1):
        for c in range(c+1):
            if (500*a + 100*b + 50*c) == x:
            count += 1

print(count)



Fixed submission:
a, b, c, x = map(int, [input() for i in range(4)])
ans = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if i * 500 + j * 100 + k * 50 == x:
                ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
a,b,c,x = map(int,input().split())
count = 0

for a in range(a+1):
    for b in range(b+1):
        for c in range(c+1):
            count += 1

print(count)



Fixed submission:
a, b, c, x = map(int, [input() for i in range(4)])
ans = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if i * 500 + j * 100 + k * 50 == x:
                ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input(),split())
if a*b%2==0:
  print('Even')
else:
  print('Odd')

Fixed submission:
a,b = map(int,input().split())
if (a * b) % 2:
  print('Odd')
else:
  print('Even')

Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
if (a * b) % 2 = 0:
  print('Even')
else:
  print('Odd')


Fixed submission:
a,b = map(int,input().split())
if (a * b) % 2:
  print('Odd')
else:
  print('Even')

Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
if (a * b) % 2:
  print(Even)
else:
  print(Odd)


Fixed submission:
a,b = map(int,input().split())
if (a * b) % 2:
  print('Odd')
else:
  print('Even')

Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
if (a * b) % 2 = 0:
  print(Even)
else:
  print(Odd)


Fixed submission:
a,b = map(int,input().split())
if (a * b) % 2:
  print('Odd')
else:
  print('Even')

Buggy python submission (verdict: Runtime Error):
a,b = map(int,imput().split())
if (a * b) % 2 = 0:
  print(Even)
else:
  print(Odd)

Fixed submission:
a,b = map(int,input().split())
if (a * b) % 2:
  print('Odd')
else:
  print('Even')
Buggy python submission (verdict: Runtime Error):
a,b = map(ste,input().split())
s = a+b
l = []
for i in range(320):
  l.append(i*i)

if int(s) in l:
  print('Yes')
else:
  print('No')


Fixed submission:
a,b = map(str,input().split())
s = a+b
l = []
for i in range(320):
  l.append(i*i)

if int(s) in l:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
s = input()
s[3]=8
print(s)

Fixed submission:
s = input()
s = s.replace('2017','2018')
print(s)

Buggy python submission (verdict: Runtime Error):
a = input()
a[3]='8'
print(a)

Fixed submission:
s = input()
s = s.replace('2017','2018')
print(s)