Buggy python submission (verdict: Runtime Error):
k, s = [int(x) for x in ks.split(" ")]
comb = []
for x in range(min(k,s) + 1)[::-1]:
    print(x)
    for y in range(min(x + 1, s - x + 1))[::-1]:
        z = s - x - y
        if (x <= k and y <= k and z <= k and y <= x and z <= y):
            comb.append([x,y,z])
count = 0
for c in comb:
    l = len(set(c))
    if l == 1:
        count += 1
    elif l == 2:
        count += 3
    else:
        count += 6
print(count)

Fixed submission:
ks = input()
k, s = [int(x) for x in ks.split(" ")]
comb = []
for x in range(min(k,s) + 1)[::-1]:
    for y in range(min(x + 1, s - x + 1))[::-1]:
        z = s - x - y
        if (x <= k and y <= k and z <= k and y <= x and z <= y):
            comb.append([x,y,z])
count = 0
for c in comb:
    l = len(set(c))
    if l == 1:
        count += 1
    elif l == 2:
        count += 3
    else:
        count += 6
print(count)

Buggy python submission (verdict: Runtime Error):
k, s = [int(x) for x in ks.split(" ")]
comb = []
for x in range(min(k,s) + 1)[::-1]:
    print(x)
    for y in range(min(x + 1, s - x + 1))[::-1]:
        z = s - x - y
        if (x <= k and y <= k and z <= k and y <= x and z <= y):
            comb.append([x,y,z])
count = 0
for c in comb:
    l = len(set(c))
    if l == 1:
        count += 1
    elif l == 2:
        count += 3
    else:
        count += 6
print(count)

Fixed submission:
ks = input()
k, s = [int(x) for x in ks.split(" ")]
comb = []
for x in range(min(k,s) + 1)[::-1]:
    for y in range(min(x + 1, s - x + 1))[::-1]:
        z = s - x - y
        if (x <= k and y <= k and z <= k and y <= x and z <= y):
            comb.append([x,y,z])
count = 0
for c in comb:
    l = len(set(c))
    if l == 1:
        count += 1
    elif l == 2:
        count += 3
    else:
        count += 6
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
ks = input()
count = 0
k, s = [int(x) for x in ks.split(" ")]
for i in range(min(k + 1,s + 2)):
    for j in range(i + 1, s + 2):
        x = i
        y = j - i - 1
        z = s - y - x
        if x <= k and y <= k and z <= k:
            count += 1
print(count)

Fixed submission:
ks = input()
k, s = [int(x) for x in ks.split(" ")]
comb = []
for x in range(min(k,s) + 1)[::-1]:
    for y in range(min(x + 1, s - x + 1))[::-1]:
        z = s - x - y
        if (x <= k and y <= k and z <= k and y <= x and z <= y):
            comb.append([x,y,z])
count = 0
for c in comb:
    l = len(set(c))
    if l == 1:
        count += 1
    elif l == 2:
        count += 3
    else:
        count += 6
print(count)

Buggy python submission (verdict: Runtime Error):
ks = input()
count = 0
k, s = [int(x) for x in sk.split(" ")]
count = 0
for i in range(min(k+1, s + 2)):
    for j in range(i + 1, s + 2):
        x = i
        y = j - i - 1
        z = s - y - x
        if x <= k and y <= k and z <= k:
            count += 1
print(count)

Fixed submission:
ks = input()
k, s = [int(x) for x in ks.split(" ")]
comb = []
for x in range(min(k,s) + 1)[::-1]:
    for y in range(min(x + 1, s - x + 1))[::-1]:
        z = s - x - y
        if (x <= k and y <= k and z <= k and y <= x and z <= y):
            comb.append([x,y,z])
count = 0
for c in comb:
    l = len(set(c))
    if l == 1:
        count += 1
    elif l == 2:
        count += 3
    else:
        count += 6
print(count)

Buggy python submission (verdict: Runtime Error):
count = 0
for i in range(min(k+1, s + 2)):
    for j in range(i + 1, s + 2):
        x = i
        y = j - i - 1
        z = s - y - x
        if x <= k and y <= k and z <= k:
            count += 1

Fixed submission:
ks = input()
k, s = [int(x) for x in ks.split(" ")]
comb = []
for x in range(min(k,s) + 1)[::-1]:
    for y in range(min(x + 1, s - x + 1))[::-1]:
        z = s - x - y
        if (x <= k and y <= k and z <= k and y <= x and z <= y):
            comb.append([x,y,z])
count = 0
for c in comb:
    l = len(set(c))
    if l == 1:
        count += 1
    elif l == 2:
        count += 3
    else:
        count += 6
print(count)

Buggy python submission (verdict: Runtime Error):
count = 0
for i in range(min(k, s + 2)):
    for j in range(i + 1, s + 2):
        x = i
        y = j - i - 1
        z = s - y - x
        if x <= k and y <= k and z <= k:
            count += 1

Fixed submission:
ks = input()
k, s = [int(x) for x in ks.split(" ")]
comb = []
for x in range(min(k,s) + 1)[::-1]:
    for y in range(min(x + 1, s - x + 1))[::-1]:
        z = s - x - y
        if (x <= k and y <= k and z <= k and y <= x and z <= y):
            comb.append([x,y,z])
count = 0
for c in comb:
    l = len(set(c))
    if l == 1:
        count += 1
    elif l == 2:
        count += 3
    else:
        count += 6
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
ks = input()
count = 0
k, s = [int(x) for x in ks.split(" ")]
for i in range(s + 2):
    for j in range(i + 1, s + 2):
        x = i
        y = j - i - 1
        z = s - y - x
        if x <= k and y <= k and z <= k:
            count += 1
print(count)

Fixed submission:
ks = input()
k, s = [int(x) for x in ks.split(" ")]
comb = []
for x in range(min(k,s) + 1)[::-1]:
    for y in range(min(x + 1, s - x + 1))[::-1]:
        z = s - x - y
        if (x <= k and y <= k and z <= k and y <= x and z <= y):
            comb.append([x,y,z])
count = 0
for c in comb:
    l = len(set(c))
    if l == 1:
        count += 1
    elif l == 2:
        count += 3
    else:
        count += 6
print(count)

Buggy python submission (verdict: Runtime Error):
sk = input()
count = 0
for i in range(s + 2):
    for j in range(i + 1, s + 2):
        x = i
        y = j - i - 1
        z = s - y - x
        if x <= k and y <= k and z <= k:
            count += 1
print(count)

Fixed submission:
ks = input()
k, s = [int(x) for x in ks.split(" ")]
comb = []
for x in range(min(k,s) + 1)[::-1]:
    for y in range(min(x + 1, s - x + 1))[::-1]:
        z = s - x - y
        if (x <= k and y <= k and z <= k and y <= x and z <= y):
            comb.append([x,y,z])
count = 0
for c in comb:
    l = len(set(c))
    if l == 1:
        count += 1
    elif l == 2:
        count += 3
    else:
        count += 6
print(count)