Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())
r = 0
for x in range(k + 1):
    for y in range(0, min(s - x + 1, k + 1)):
        z = s - x - y
        if 0 <= z <= k and z + x + y == s:
            r += 1
print(r)


Fixed submission:
k, s = map(int, input().split())
n = 0
for i in range(k + 1):
    if (s-i)/2 > k:
        continue
    elif i > s:
        break
    for j in range(k+1):
        z = s - i - j
        if 0<= z <= k:
            n += 1
print(n)

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


Fixed submission:
k, s = map(int, input().split())
n = 0
for i in range(k + 1):
    if (s-i)/2 > k:
        continue
    elif i > s:
        break
    for j in range(k+1):
        z = s - i - j
        if 0<= z <= k:
            n += 1
print(n)

Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())
n = 0
for i in range(k + 1):
    if (s-i)/2 > k:
        continue
    elif i > s:
        break
    for j in range(s-i+1):
        if s-i-j > k:
            continue
        elif j > k:
            break
        z = s - i - j
        if 0<= z <= k:
            n += 1
print(n)


Fixed submission:
k, s = map(int, input().split())
n = 0
for i in range(k + 1):
    if (s-i)/2 > k:
        continue
    elif i > s:
        break
    for j in range(k+1):
        z = s - i - j
        if 0<= z <= k:
            n += 1
print(n)

Buggy python submission (verdict: Runtime Error):
k, s = map(int, input().split())
n = 0
for i in range(k + 1):
    if (s-i)/2 > k:
        continue
    elif i > s:
        break
    for j in range(s-i+1):
        if s-i-j > k:
            continue
        elif j > k:
            break
        z = s - i - j
        if 0<= z <= k
print(n)


Fixed submission:
k, s = map(int, input().split())
n = 0
for i in range(k + 1):
    if (s-i)/2 > k:
        continue
    elif i > s:
        break
    for j in range(k+1):
        z = s - i - j
        if 0<= z <= k:
            n += 1
print(n)

Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())
n = 0
for i in range(k + 1):
    if (s-i)/2 > k:
        continue
    elif i > s:
        break
    for j in range(s-i+1):
        if s-i-j > k:
            continue
        elif j > k:
            break
        for l in range(s-i-j + 1):
            if i + j + l == s:
                n += 1
            elif i + j + l > s:
                break
print(n)


Fixed submission:
k, s = map(int, input().split())
n = 0
for i in range(k + 1):
    if (s-i)/2 > k:
        continue
    elif i > s:
        break
    for j in range(k+1):
        z = s - i - j
        if 0<= z <= k:
            n += 1
print(n)

Buggy python submission (verdict: Runtime Error):
k, s = map(int, input().split())
n = 0
for i in range(k + 1):
    if (s-i)/2 > k:
        continue
    elif i > s:
        break
    for j in range(s-i+1):
        if s-i-j > k:
            continue
        elif j > k:
            break
        for l in range(s-i-j + 1):
            if i + j + l == s:
                n += 1
            elif i + j + l > s:
                break
print(n)
vv

Fixed submission:
k, s = map(int, input().split())
n = 0
for i in range(k + 1):
    if (s-i)/2 > k:
        continue
    elif i > s:
        break
    for j in range(k+1):
        z = s - i - j
        if 0<= z <= k:
            n += 1
print(n)

Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())
n = 0
for i in range(k + 1):
    if (s-i)/2 > k:
        continue
    elif i > s:
        break
    for j in range(k + 1):
        if s-i-j > k:
            continue
        elif j > s:
            break
        for l in range(k + 1):
            if i + j + l == s:
                n += 1
            elif i + j + l > s:
                break
print(n)


Fixed submission:
k, s = map(int, input().split())
n = 0
for i in range(k + 1):
    if (s-i)/2 > k:
        continue
    elif i > s:
        break
    for j in range(k+1):
        z = s - i - j
        if 0<= z <= k:
            n += 1
print(n)

Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())
n = 0
for i in range(k + 1):
    if (s-i)/2 > k or i > s:
        continue
    for j in range(k + 1):
        if s-i-j > k or j > s:
            continue
        for l in range(k + 1):
            if i + j + l == s:
                n += 1
            elif i + j + l > s:
                break
print(n)


Fixed submission:
k, s = map(int, input().split())
n = 0
for i in range(k + 1):
    if (s-i)/2 > k:
        continue
    elif i > s:
        break
    for j in range(k+1):
        z = s - i - j
        if 0<= z <= k:
            n += 1
print(n)

Buggy python submission (verdict: Runtime Error):
\k, s = map(int, input().split())
n = 0
a = k + 1
if k == s:
    n += 3
if k*2 > s:
    n += s*3
for i in range(1,k + 1):
    if (s-i)/2 > k:
        continue
    for j in range(1,k + 1):
        if s-i-j > k:
            continue
        for l in range(1,k + 1):
            if i + j + l == s:
                n += 1
print(n)


Fixed submission:
k, s = map(int, input().split())
n = 0
for i in range(k + 1):
    if (s-i)/2 > k:
        continue
    elif i > s:
        break
    for j in range(k+1):
        z = s - i - j
        if 0<= z <= k:
            n += 1
print(n)