Buggy python submission (verdict: Time Limit Exceeded):
R,G,B,N = map(int,input().split())

r = 0
count = 0
r_max = N // R

while r <= r_max:

    g_max = (N-r*R)//G
    g = 0
    while N-r*R-g*G >= 0:
        b = (N-r*R-g*G)/B
        if b.is_integer() and b >= 0:
            count += 1

        g += 1
    
    r += 1

print(count)


Fixed submission:
R,G,B,N = map(int,input().split())

count = 0
for r in range(0,N+1,R):
    for g in range(r,N+1,G):
        b = (N-g)/B
        if b.is_integer() and b >= 0:
            count += 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
R,G,B,N = map(int,input().split())

R,G,B = reversed([R,G,B])
r = 0
count = 0
r_max = N // R

while r <= r_max:
    
    g_max = (N-r*R)//G
    g = 0
    while g <= g_max:
        b = (N-r*R-g*G)/B
        if b.is_integer() and b >= 0:
            count += 1

        g += 1
    
    r += 1

print(count)

Fixed submission:
R,G,B,N = map(int,input().split())

count = 0
for r in range(0,N+1,R):
    for g in range(r,N+1,G):
        b = (N-g)/B
        if b.is_integer() and b >= 0:
            count += 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
R,G,B,N = map(int,input().split())

# R,G,B = reversed([R,G,B])
r = 0
count = 0
r_max = N // R

while r <= r_max:
    
    g_max = (N-r*R)//G
    g = 0
    while g <= g_max:
        b = (N-r*R-g*G)/B
        if b.is_integer() and b >= 0:
            count += 1

        g += 1
    
    r += 1

print(count)

Fixed submission:
R,G,B,N = map(int,input().split())

count = 0
for r in range(0,N+1,R):
    for g in range(r,N+1,G):
        b = (N-g)/B
        if b.is_integer() and b >= 0:
            count += 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
R,G,B,N = map(int,input().split())

# R,G,B = reversed([R,G,B])
r = 0
count = 0
r_max = N // R

while r <= r_max:
    
    g_max = (N-r*R)//G
    g = 0
    while g <= g_max:
        b = (N-r*R-g*G)/B
        if b.is_integer() and b >= 0:
            count += 1

        g += 1
    
    r += 1

print(count)

Fixed submission:
R,G,B,N = map(int,input().split())

count = 0
for r in range(0,N+1,R):
    for g in range(r,N+1,G):
        b = (N-g)/B
        if b.is_integer() and b >= 0:
            count += 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
R,G,B,N = map(int,input().split())

R,G,B = reversed([R,G,B])
r = 0
count = 0
r_max = N // R
g_max = N // G

while r <= r_max:
    
    g = 0
    while g <= g_max:
        b = (N-r*R-g*G)/B
        if b.is_integer() and b >= 0:
            count += 1

        g += 1
    
    r += 1

print(count)

Fixed submission:
R,G,B,N = map(int,input().split())

count = 0
for r in range(0,N+1,R):
    for g in range(r,N+1,G):
        b = (N-g)/B
        if b.is_integer() and b >= 0:
            count += 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
R,G,B,N = map(int,input().split())

r = 0
count = 0
r_max = N // R
g_max = N // G

while r <= r_max:
    
    g = 0
    while g <= g_max:
        b = (N-r*R-g*G)/B
        if b.is_integer() and b >= 0:
            count += 1

        g += 1
    
    r += 1

print(count)

Fixed submission:
R,G,B,N = map(int,input().split())

count = 0
for r in range(0,N+1,R):
    for g in range(r,N+1,G):
        b = (N-g)/B
        if b.is_integer() and b >= 0:
            count += 1

print(count)