Buggy python submission (verdict: Time Limit Exceeded):
vec = input().split(' ')
k = int(vec[0])
s = int(vec[1])
count = 0
for x in range(k + 1):
    if x <= s:
        for y in range(k + 1):
            if x + y <= s:
                z = s - x - y
                if z >= 0 and z <= k:
                    count += 1
print(count)

Fixed submission:
vec = input().split(' ')
k = int(vec[0])
s = int(vec[1])
count = 0
for x in range(k + 1):
    if x <= s:
        for y in range(k + 1):
            if x + y <= s:
                z = s - x - y
                if z >= 0 and z <= k:
                    count += 1
            else: break
    else: break
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
vec = input().split(' ')
k = int(vec[0])
count = 0

for x in range(k + 1):
    for y in range(k + 1):
        z = int(vec[1]) - x - y
        if z >= 0 and z <= k:
            count += 1

print(count)

Fixed submission:
vec = input().split(' ')
k = int(vec[0])
s = int(vec[1])
count = 0
for x in range(k + 1):
    if x <= s:
        for y in range(k + 1):
            if x + y <= s:
                z = s - x - y
                if z >= 0 and z <= k:
                    count += 1
            else: break
    else: break
print(count)

Buggy python submission (verdict: Runtime Error):
vec = input().split(' ')
k = int(vec[0]) + 1
count = 0

for x in range(k):
  for y in range(k):
    z = int(vec[1]) - x - y
    if z >= 0 and z <= k:
	  count += 1

print(count)

Fixed submission:
vec = input().split(' ')
k = int(vec[0])
s = int(vec[1])
count = 0
for x in range(k + 1):
    if x <= s:
        for y in range(k + 1):
            if x + y <= s:
                z = s - x - y
                if z >= 0 and z <= k:
                    count += 1
            else: break
    else: break
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
vec = input().split(' ')
k = int(vec[0])
s = int(vec[1])
count = 0

for x in range(k + 1):
  for y in range(k + 1):
    for z in range(k + 1):
      if x + y + z == s:
        count += 1

print(count)

Fixed submission:
vec = input().split(' ')
k = int(vec[0])
s = int(vec[1])
count = 0
for x in range(k + 1):
    if x <= s:
        for y in range(k + 1):
            if x + y <= s:
                z = s - x - y
                if z >= 0 and z <= k:
                    count += 1
            else: break
    else: break
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
a = list(map(int,input().split()))
k = int(a[0])
s = int(a[1])
count = 0

for x in range(k+1):
    if (x == s):
       count += 1
    else: 
        for y in range(k+1):
             if (x + y == s):
                 count += 1
             else:
                for z in range(k+1):
                    if(x + y + z == s):
                        count += 1

print(count)

Fixed submission:
a = list(map(int,input().split()))
k = int(a[0])
s = int(a[1])
count = 0

for x in range(k+1):
    for y in range(k+1):
        if(s-x-y >= 0) and (s-x-y <= k):
            count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
a = list(map(int,input().split()))
k = int(a[0])
s = int(a[1])
count = 0

for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
            if(x + y + z == s):
                count += 1

print(count)

Fixed submission:
a = list(map(int,input().split()))
k = int(a[0])
s = int(a[1])
count = 0

for x in range(k+1):
    for y in range(k+1):
        if(s-x-y >= 0) and (s-x-y <= k):
            count += 1
print(count)