Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())
count = 0
for x in range(k+1):
    if x > s:
        break
    if x == s:
        count +=1
        break
    for y in range(k+1):
        if x+y > s:
            break
        if x+y == s:
            count +=1
            break
        for z in range(k+1):
            if x+y+z > s:
                break
            if x+y+z == s:
                count += 1
print(count)

Fixed submission:
k, s = map(int, input().split())
count = 0

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

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())
if s < k:
    k = s

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

print(count)

Fixed submission:
k, s = map(int, input().split())
count = 0

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

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())
if s < k:
    k = s

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

print(count)


Fixed submission:
k, s = map(int, input().split())
count = 0

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

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())
if s < k:
    k = s

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

print(count)

Fixed submission:
k, s = map(int, input().split())
count = 0

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

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())
if s < k:
    k = s

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:
k, s = map(int, input().split())
count = 0

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

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())
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:
k, s = map(int, input().split())
count = 0

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

print(count)