Buggy python submission (verdict: Time Limit Exceeded):
# 2020/07/26
# diverta 2019 Programming Contest - B

# Input
r, g, b, n = map(int,input().split())

ans = 0

# Calc
for ir in range(n+1):
    vr = r * ir 
    if vr > n:
        break

    for ig in range(n+1):
        vg = g * ig 
        if vg > n:
            break
        cb = n - vr - vg
        if cb >= 0 and cb % b == 0:
            ans = ans + 1

# Output
print(ans)


Fixed submission:
# 2019/05/12
# diverta 2019 Programming Contest - B

# Input
r, g, b, n = map(int, input().split())

# Init
cnt = 0

# Calc
for i in range(n+1):
    rcnt = r * i
    if rcnt > n:
        break
    
    for j in range(n+1):
        rgcnt = rcnt + g * j
        if rgcnt > n:
            break
        bcnt = n - rgcnt
        if bcnt % b == 0:
            cnt += 1
# Output
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
# 2020/07/26
# diverta 2019 Programming Contest - B

# Input
r, g, b, n = map(int,input().split())

ans = 0

# Calc
for ir in range(n+1):
    vr = r * ir 
    if vr > n:
        break

    for ig in range(n+1):
        vg = g * ig 
        if vg > n:
            break
        cb = n - r * ir - vg
        if cb >= 0 and cb % b == 0:
            ans = ans + 1

# Output
print(ans)


Fixed submission:
# 2019/05/12
# diverta 2019 Programming Contest - B

# Input
r, g, b, n = map(int, input().split())

# Init
cnt = 0

# Calc
for i in range(n+1):
    rcnt = r * i
    if rcnt > n:
        break
    
    for j in range(n+1):
        rgcnt = rcnt + g * j
        if rgcnt > n:
            break
        bcnt = n - rgcnt
        if bcnt % b == 0:
            cnt += 1
# Output
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
# 2020/07/26
# diverta 2019 Programming Contest - B

# Input
r, g, b, n = map(int,input().split())

ans = 0

# Calc
for ir in range(n+1):
    for ig in range(n+1):
        cb = n - r * ir - g * ig
        if cb >= 0 and cb % b == 0:
            ans = ans + 1

# Output
print(ans)


Fixed submission:
# 2019/05/12
# diverta 2019 Programming Contest - B

# Input
r, g, b, n = map(int, input().split())

# Init
cnt = 0

# Calc
for i in range(n+1):
    rcnt = r * i
    if rcnt > n:
        break
    
    for j in range(n+1):
        rgcnt = rcnt + g * j
        if rgcnt > n:
            break
        bcnt = n - rgcnt
        if bcnt % b == 0:
            cnt += 1
# Output
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
# 2019/05/12
# diverta 2019 Programming Contest - B

# Input
r, g, b, n = map(int, input().split())

cnt = 0
for i in range(n+1):
    
    rcnt = r * i
    if rcnt > n:
        break
    
    for j in range(n+1):
        gcnt = g * j
        rgcnt = rcnt + gcnt
        if rgcnt > n:
            break

        bcnt = n - rgcnt
        if bcnt % b == 0:
            cnt += 1

print(cnt)


Fixed submission:
# 2019/05/12
# diverta 2019 Programming Contest - B

# Input
r, g, b, n = map(int, input().split())

# Init
cnt = 0

# Calc
for i in range(n+1):
    rcnt = r * i
    if rcnt > n:
        break
    
    for j in range(n+1):
        rgcnt = rcnt + g * j
        if rgcnt > n:
            break
        bcnt = n - rgcnt
        if bcnt % b == 0:
            cnt += 1
# Output
print(cnt)