Buggy python submission (verdict: Runtime Error):
X = int(input())

if X >= 0 and X <= 10 ** 9:
    while True:
        if X >= 500:
            C = X // 500
            X = X - (500 * C)
        elif X >= 5:
            D = X // 5
            X = X - (5 * D)
        else:
            break

total = (1000 * C) + (5 * D)

print(total)

Fixed submission:
X = int(input())

C = 0
P = 0
D = 0
L = 0
total = 0

if X >= 0 and X <= 10 ** 9:
    while True:
        if X >= 500:
            C = X // 500
            P = 500 * C
            X = X - P
        elif X >= 5:
            D = X // 5
            L = 5 * D
            X = X - L
        else:
            break
man = 1000 * C
t   = 5 * D

total = man + t

print(total)

Buggy python submission (verdict: Runtime Error):
X = int(input())

if X >= 0 and X <= 10 ** 9:
    while True:
        if X >= 500:
            C = X // 500
            X = X - (500 * C)
        elif X >= 5:
            D = X // 5
            X = X - (5 * D)
        else:
            break

total = (1000 * C) + (5 * D)

print(total)

Fixed submission:
X = int(input())

C = 0
P = 0
D = 0
L = 0
total = 0

if X >= 0 and X <= 10 ** 9:
    while True:
        if X >= 500:
            C = X // 500
            P = 500 * C
            X = X - P
        elif X >= 5:
            D = X // 5
            L = 5 * D
            X = X - L
        else:
            break
man = 1000 * C
t   = 5 * D

total = man + t

print(total)

Buggy python submission (verdict: Runtime Error):
X = int(input())

while True:
    if X >= 500:
        C = X // 500
        X = X - (500 * C)
    elif X >= 5:
        D = X // 5
        X = X - (5 * D)
    else:
        break

total = (500 * C) + (5 * D)

print(total)

Fixed submission:
X = int(input())

C = 0
P = 0
D = 0
L = 0
total = 0

if X >= 0 and X <= 10 ** 9:
    while True:
        if X >= 500:
            C = X // 500
            P = 500 * C
            X = X - P
        elif X >= 5:
            D = X // 5
            L = 5 * D
            X = X - L
        else:
            break
man = 1000 * C
t   = 5 * D

total = man + t

print(total)

Buggy python submission (verdict: Runtime Error):
X = int(input())

if X >= 0 and X <= 10 ** 9:
    while True:
        if X >= 500:
            C = X // 500
            X = X - (500 * C)
        elif X >= 5:
            D = X // 5
            X = X - (5 * D)
        else:
            break

total = (500 * C) + (5 * D)

print(total)

Fixed submission:
X = int(input())

C = 0
P = 0
D = 0
L = 0
total = 0

if X >= 0 and X <= 10 ** 9:
    while True:
        if X >= 500:
            C = X // 500
            P = 500 * C
            X = X - P
        elif X >= 5:
            D = X // 5
            L = 5 * D
            X = X - L
        else:
            break
man = 1000 * C
t   = 5 * D

total = man + t

print(total)

Buggy python submission (verdict: Runtime Error):
X = int(input())

if X >= 0 and X <= 10 ** 9:
    while True:
        if X > 500:
            C = X // 500
            P = 500 * C
            X = X - P
        elif X > 5:
            D = X // 5
            L = 5 * D
            X = X - L
        else:
            break

total = (1000 * C) + (5 * D)

print(total)

Fixed submission:
X = int(input())

C = 0
P = 0
D = 0
L = 0
total = 0

if X >= 0 and X <= 10 ** 9:
    while True:
        if X >= 500:
            C = X // 500
            P = 500 * C
            X = X - P
        elif X >= 5:
            D = X // 5
            L = 5 * D
            X = X - L
        else:
            break
man = 1000 * C
t   = 5 * D

total = man + t

print(total)

Buggy python submission (verdict: Runtime Error):
X = int(input())

if X >= 0 and X <= 10 ** 9:
    while True:
        if X > 500:
            C = X // 500
            P = 500 * C
            X = X - P
            continue
        if X > 5:
            D = X // 5
            L = 5 * D
            X = X - L
            continue
        break

total = (1000 * C) + (5 * D)

print(total)

Fixed submission:
X = int(input())

C = 0
P = 0
D = 0
L = 0
total = 0

if X >= 0 and X <= 10 ** 9:
    while True:
        if X >= 500:
            C = X // 500
            P = 500 * C
            X = X - P
        elif X >= 5:
            D = X // 5
            L = 5 * D
            X = X - L
        else:
            break
man = 1000 * C
t   = 5 * D

total = man + t

print(total)

Buggy python submission (verdict: Runtime Error):
X = int(input())

a = 0
b = 0
c = 0
d = 0
e = 0
f = 0

for q in range(100):
    for w in range(100):
        for e in range(100):
            for r in range(100):
                for t in range(100):
                    for y in range(100):
                        num = (500 * q) + (100 * w) + (50 * e) + (10 * r) + (5 * t) + (1 * y)
                        if X % num == 0:
                            m = q
                            i = t
                            break


print(500 * m + 5 * i)

Fixed submission:
X = int(input())

C = 0
P = 0
D = 0
L = 0
total = 0

if X >= 0 and X <= 10 ** 9:
    while True:
        if X >= 500:
            C = X // 500
            P = 500 * C
            X = X - P
        elif X >= 5:
            D = X // 5
            L = 5 * D
            X = X - L
        else:
            break
man = 1000 * C
t   = 5 * D

total = man + t

print(total)