Buggy python submission (verdict: Runtime Error):
ans = 0
k, s = map(int, input().split())
for x in range(k):
  for y in range(k):
    int z = s - x - y
    if 0 <= z and z <= k:
      ans += 1



print(ans)

Fixed submission:
ans = 0
k, s = map(int, input().split())
for x in range(k+1):
  for y in range(k+1):
    z = s - x - y
    if 0 <= z and z <= k:
      ans += 1
 
 
 
print(ans)

Buggy python submission (verdict: Runtime Error):
def comb(n, r):
  if r == 0  or n == r: return 1
  else: return comb(n-1, r) + comb(n-1, r-1)
 
k, s = map(int, input().split())
if s <= k: print(comb(s+2, 2))
elif s <= 2*k: print(3*comb(s-k+2, 2))
else: print(3*comb(s-2*k+2,2))

Fixed submission:
ans = 0
k, s = map(int, input().split())
for x in range(k+1):
  for y in range(k+1):
    z = s - x - y
    if 0 <= z and z <= k:
      ans += 1
 
 
 
print(ans)

Buggy python submission (verdict: Runtime Error):
def comb(n, r):
  if r == 0  or n == r: return 1
  else: return comb(n-1, r) + comb(n-1, r-1)
 
k, s = map(int, input().split())
if s <= k: print(comb(s+2, 2))
elif s <= 2*k: print(3*comb(s-k+2, 2))
else: print(3*comb(s-2k+2,2))

Fixed submission:
ans = 0
k, s = map(int, input().split())
for x in range(k+1):
  for y in range(k+1):
    z = s - x - y
    if 0 <= z and z <= k:
      ans += 1
 
 
 
print(ans)

Buggy python submission (verdict: Runtime Error):
def comb(n, r):
  if r == 0  or n == r: return 1
  else: return comb(n-1, r) + comb(n-1, r-1)
 
k, s = map(int, input().split())
if s < k: print(comb(s+2, 2))
elif s < 2*k: print(3*comb(s-k+2, 2))
else: print(3*comb(s-2k+2,2))

Fixed submission:
ans = 0
k, s = map(int, input().split())
for x in range(k+1):
  for y in range(k+1):
    z = s - x - y
    if 0 <= z and z <= k:
      ans += 1
 
 
 
print(ans)

Buggy python submission (verdict: Runtime Error):
def comb(n, r):
  if r == 0  or n == r: return 1
  else: return comb(n-1, r) + comb(n-1, r-1)

k, s = map(int, input().split())
if s < k: print(comb(s+2, 2))
elif s < 2k: print(3*comb(s-k+2, 2))
else: print(3*comb(s-2k+2,2))

Fixed submission:
ans = 0
k, s = map(int, input().split())
for x in range(k+1):
  for y in range(k+1):
    z = s - x - y
    if 0 <= z and z <= k:
      ans += 1
 
 
 
print(ans)

Buggy python submission (verdict: Runtime Error):
def comb(n, r):
  if r == 0  or n == r: return 1
  else: return comb(n-1, r) + comb(n-1, r-1)

k, s = map(int, input().split())
print(comb(s-3k+2, 2))

Fixed submission:
ans = 0
k, s = map(int, input().split())
for x in range(k+1):
  for y in range(k+1):
    z = s - x - y
    if 0 <= z and z <= k:
      ans += 1
 
 
 
print(ans)

Buggy python submission (verdict: Runtime Error):
def comb(n, r):
  if r == 0  or n == r: return 1
  else: return comb(n-1, r) + comb(n-1, r-1)
 
k, s = map(int, input().split())
print(comb(s-3k+2, 2))

Fixed submission:
ans = 0
k, s = map(int, input().split())
for x in range(k+1):
  for y in range(k+1):
    z = s - x - y
    if 0 <= z and z <= k:
      ans += 1
 
 
 
print(ans)

Buggy python submission (verdict: Runtime Error):
def comb(n, r):
  if r == 0  or n == k: return 1
  else: return comb(n-1, r) + comb(n-1, r-1)
 
k, s = map(int, input().split())
print(comb(s-3k+2, 2))

Fixed submission:
ans = 0
k, s = map(int, input().split())
for x in range(k+1):
  for y in range(k+1):
    z = s - x - y
    if 0 <= z and z <= k:
      ans += 1
 
 
 
print(ans)

Buggy python submission (verdict: Runtime Error):
def comb(n, k):
  if k == 0  or n == k: return 1
  else: return comb(n-1, k) + comb(n-1, k-1)

k, s = map(int, input().split())
print(comb(n-3k+2, 2))

Fixed submission:
ans = 0
k, s = map(int, input().split())
for x in range(k+1):
  for y in range(k+1):
    z = s - x - y
    if 0 <= z and z <= k:
      ans += 1
 
 
 
print(ans)