Buggy python submission (verdict: Runtime Error):
def combinations(R, G, B, N):
    R, G, B, N = int(R), int(G), int(B), int(N)
    sorted_tuple = sorted((R, G, B), reverse=True)
    R = sorted_tuple[0]
    G = sorted_tuple[1]
    B = sorted_tuple[2]
    number_combos = 0
    print(R)
    print(G)
    print(B)
    for x in range(N + 1):
        N_modified_x = N - R * x
        for y in range(N_modified_x + 1):
            N_modified_y = N_modified_x - G * y
            for z in range(N_modified_y + 1):
                if B * z == N_modified_y:
                    number_combos += 1
    return number_combos

R, G, B, N = input().split(' ')
print(combinations(R, G, B, N))

Fixed submission:
def combinations(N, K):
    N = int(N)
    K = int(K)
    if N == K:
        return 1
    else:
        return N - K + 1
    
N, K = input().split(' ')

print(combinations(N, K))

Buggy python submission (verdict: Runtime Error):
%%time
def combinations(R, G, B, N):
    R, G, B, N = int(R), int(G), int(B), int(N)
    sorted_tuple = sorted((R, G, B), reverse=True)
    R = sorted_tuple[0]
    G = sorted_tuple[1]
    B = sorted_tuple[2]
    number_combos = 0
    
    for x in range(N + 1):
        N_modified_x = N - R * x
        for y in range(N_modified_x + 1):
            N_modified_y = N_modified_x - G * y
            for z in range(N_modified_y + 1):
                if B * z == N_modified_y:
                    number_combos += 1
    return number_combos

R, G, B, N = input().split(' ')
print(combinations(R, G, B, N))

Fixed submission:
def combinations(N, K):
    N = int(N)
    K = int(K)
    if N == K:
        return 1
    else:
        return N - K + 1
    
N, K = input().split(' ')

print(combinations(N, K))

Buggy python submission (verdict: Runtime Error):
def combinations(N, K):
    N = int(N)
    K = int(K)
    elif N == K:
        return 1
    else:
        return N - K + 1
    
N, K = input().split(' ')

print(combinations(N, K))

Fixed submission:
def combinations(N, K):
    N = int(N)
    K = int(K)
    if N == K:
        return 1
    else:
        return N - K + 1
    
N, K = input().split(' ')

print(combinations(N, K))

Buggy python submission (verdict: Runtime Error):
def combinations(N, K):
    N = int(N)
    K = int(K)
    k_ex = K
    n_ex = N
    n_k_ex = N - K
    for i in range(1, K):
        k_ex *= i
    for i in range(1, N):
        n_ex *= i
    for i in range(1, N - K):
        n_k_ex *= i
    return int(n_ex / (k_ex * n_k_ex))
N, K = input().split(' ')

print(combinations(N, K))

Fixed submission:
def combinations(N, K):
    N = int(N)
    K = int(K)
    if N == K:
        return 1
    else:
        return N - K + 1
    
N, K = input().split(' ')

print(combinations(N, K))

Buggy python submission (verdict: Runtime Error):
def combinations(N, K):
    N = int(N)
    K = int(K)
    k_ex = K
    n_ex = N
    n_k_ex = N - K
    for i in range(1, K + 1):
        k_ex *= i
    for i in range(1, N + 1):
        n_ex *= i
    for i in range(1, N - K + 1):
        n_k_ex *= i
    return int(n_ex / (k_ex * n_k_ex))
N, K = input().split(' ')

print(combinations(N, K))

Fixed submission:
def combinations(N, K):
    N = int(N)
    K = int(K)
    if N == K:
        return 1
    else:
        return N - K + 1
    
N, K = input().split(' ')

print(combinations(N, K))