Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys


def solve(R: int, G: int, B: int, N: int):
    cnt= 0
    for r in range(0, N+1, R):
        for g in range(0, N + 1 - r, G):
            if N - r - g < 0:
                break
            b = (N - r - g) / B
            if b % 1 == 0 and b >= 0:
                cnt += 1
            else:
                continue
    print(cnt)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    R = int(next(tokens))  # type: int
    G = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    solve(R, G, B, N)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys


def solve(R: int, G: int, B: int, N: int):
    cnt= 0
    for r in range(0, N + 1, R):
        upper = N + 1 - r
        for g in range(0, upper, G):
            temp = upper-1-g
            if temp < 0:
                break
            b = temp / B
            if b % 1 == 0 and b >= 0:
                cnt += 1
            else:
                continue
    print(cnt)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    R = int(next(tokens))  # type: int
    G = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    solve(R, G, B, N)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys


def solve(R: int, G: int, B: int, N: int):
    cnt= 0
    for r in range(0, N+1, R):
        for g in range(0, N + 1 - r, G):
            b = (N - r - g) / B
            if b % 1 == 0 and b >= 0:
                cnt += 1
            else:
                continue
            if N - r - g < 0:
                break

    print(cnt)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    R = int(next(tokens))  # type: int
    G = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    solve(R, G, B, N)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys


def solve(R: int, G: int, B: int, N: int):
    cnt= 0
    for r in range(0, N + 1, R):
        upper = N + 1 - r
        for g in range(0, upper, G):
            temp = upper-1-g
            if temp < 0:
                break
            b = temp / B
            if b % 1 == 0 and b >= 0:
                cnt += 1
            else:
                continue
    print(cnt)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    R = int(next(tokens))  # type: int
    G = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    solve(R, G, B, N)

if __name__ == '__main__':
    main()