Buggy python submission (verdict: Time Limit Exceeded):
import collections
import itertools
import functools
import math
import scipy.special

if __name__ == "__main__":
    k, s = map(int, input().split())
    res = 0
    mi = min(k, s)
    ma = max(k, s)
    for i in range(mi + 1):
        for j in range(mi + 1):
            res += int(0 <= s - i - j and s - i - j <= k)
    print(res)

Fixed submission:
import collections
import itertools
import functools
import math
import scipy.special

if __name__ == "__main__":
    k, s = map(int, input().split())
    res = 0
    for i in range(k + 1):
        for j in range(k + 1):
            if 0 <= s - i - j <= k:
                res += 1
    print(res)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
import itertools
import functools
import math
import scipy.special

if __name__ == "__main__":
    k, s = map(int, input().split())
    res = 0
    mi = min(k, s)
    ma = max(k, s)
    for i in range(mi + 1):
        for j in range(mi + 1):
            res += int(0 <= s - i - j <= k)
    print(res)

Fixed submission:
import collections
import itertools
import functools
import math
import scipy.special

if __name__ == "__main__":
    k, s = map(int, input().split())
    res = 0
    for i in range(k + 1):
        for j in range(k + 1):
            if 0 <= s - i - j <= k:
                res += 1
    print(res)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
import itertools
import functools
import math
import scipy.special

if __name__ == "__main__":
    k, s = map(int, input().split())
    res = 0
    for i in range(k + 1):
        for j in range(k + 1):
            res += int(0 <= s - i - j <= k)
    print(res)

Fixed submission:
import collections
import itertools
import functools
import math
import scipy.special

if __name__ == "__main__":
    k, s = map(int, input().split())
    res = 0
    for i in range(k + 1):
        for j in range(k + 1):
            if 0 <= s - i - j <= k:
                res += 1
    print(res)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
import itertools
import functools
import math
import scipy.special

if __name__ == "__main__":
    k, s = map(int, input().split())
    res = 0
    for i in range(k + 1):
        for j in range(k + 1):
            res += int(0 <= s - i - j <= k)
    print(res)

Fixed submission:
import collections
import itertools
import functools
import math
import scipy.special

if __name__ == "__main__":
    k, s = map(int, input().split())
    res = 0
    for i in range(k + 1):
        for j in range(k + 1):
            if 0 <= s - i - j <= k:
                res += 1
    print(res)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
import itertools
import functools
import math

if __name__ == "__main__":
    k, s = map(int, input().split())
    res = 0
    for i in range(k + 1):
        for j in range(k + 1):
            for k in range(k + 1):
                res += int(i + j + k == s)

    print(res)

Fixed submission:
import collections
import itertools
import functools
import math
import scipy.special

if __name__ == "__main__":
    k, s = map(int, input().split())
    res = 0
    for i in range(k + 1):
        for j in range(k + 1):
            if 0 <= s - i - j <= k:
                res += 1
    print(res)