Buggy python submission (verdict: Runtime Error):
import numpy as np

def count_true(matrix:np.array, s:int):
    return np.count_nonzero(matrix == s)


def unk(k:int, s:int):
    # 条件チェック
    if all([(2 <= k <= 2000), (0 <= s <= 3*k)]):

        x = y = z = np.array([range(0,k+1)])
        c = count_true(np.ravel(x.T+y)+ z.T, s)

        print(c)


if __name__ == '__main__':
    data = input().split(" ")
    data = list(map(int, data))
    unk(data[0], data[1])


Fixed submission:
data = input().split(" ")
data = list(map(int, data))

count=0

for x in range(data[0]+1):
    for y in range(data[0]+1):
        if data[0] >= (data[1]-(x+y)) >= 0:
            z = data[1]-(x+y)
            
            if x + y + z == data[1]:
                count+=1
print(count)

Buggy python submission (verdict: Runtime Error):
import numpy as np

def count_true(matrix:np.array, s:int):
    return np.count_nonzero(matrix == s)


def unk(k:int, s:int):
    # 条件チェック
    if all([(2 <= k <= 2000), (0 <= s <= 3*k)]):

        x = y = z = np.array([range(0,k+1)])
        c = count_true(np.ravel(x.T+y)+ z.T, s)

        print(c)


if __name__ == '__main__':
　　　　data = input().split(" ")
　　　　data = list(map(int, data))
　　　　unk(data[0], data[1])


Fixed submission:
data = input().split(" ")
data = list(map(int, data))

count=0

for x in range(data[0]+1):
    for y in range(data[0]+1):
        if data[0] >= (data[1]-(x+y)) >= 0:
            z = data[1]-(x+y)
            
            if x + y + z == data[1]:
                count+=1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
data = input().split(" ")
data = list(map(int, data))

count=0

for x in range(data[0]+1):
    for y in range(data[0]+1):
        
        # 枝刈り
        if x+y>data[1]:
            break
        
        if data[0] >= (data[1]-(x+y)) >= 0:
            z = data[1]-(x+y)
            
            if x + y + z == data[1]:
                count+=1
print(count)

Fixed submission:
data = input().split(" ")
data = list(map(int, data))

count=0

for x in range(data[0]+1):
    for y in range(data[0]+1):
        if data[0] >= (data[1]-(x+y)) >= 0:
            z = data[1]-(x+y)
            
            if x + y + z == data[1]:
                count+=1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
data = input().split(" ")
data = list(map(int, data))

count=0

for x in range(data[0]+1):
    for y in range(data[0]+1):
        if data[0] >= (data[1]-(x+y)) >= 0:
            z = data[1]-(x+y)
            
            if x + y + z == data[1]:
                count+=1
print(count)

Fixed submission:
data = input().split(" ")
data = list(map(int, data))

count=0

for x in range(data[0]+1):
    for y in range(data[0]+1):
        if data[0] >= (data[1]-(x+y)) >= 0:
            z = data[1]-(x+y)
            
            if x + y + z == data[1]:
                count+=1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
data = input().split(" ")
data = list(map(int, data))

count=0

for x in range(data[0]+1):
    for y in range(data[0]+1):
        for z in range(data[0]+1):
            if x + y + z == data[1]:
                count+=1
print(count)

Fixed submission:
data = input().split(" ")
data = list(map(int, data))

count=0

for x in range(data[0]+1):
    for y in range(data[0]+1):
        if data[0] >= (data[1]-(x+y)) >= 0:
            z = data[1]-(x+y)
            
            if x + y + z == data[1]:
                count+=1
print(count)