Buggy python submission (verdict: Runtime Error):
def main():
    A, B, C, D, E, F = map(int, input().split())
    ans = 0
    for a in range(F // (A * 100) + 1):
        for b in range((F - 100 * A * a) // (B * 100) + 1):
            for c in range((F - 100 * A * a - 100 * B * b) // C + 1):
                for d in range((F - 100 * A * a - 100 * B * b - C * c) // D + 1):
                    x = a * A + b * B
                    y = c * C + d * D
                    if x == 0:
                        continue
                    if x * E >= y and ans < (100 * y)/(x*100+y):
                        ans = (100 * y)/(x*100+y)
                        sugar = y
                        sugar_water = 100 * x + y
    print(sugar_water,sugar)

if __name__ == "__main__":
    main()

Fixed submission:
A, B, C, D, E, F = map(int, input().split())

sugar_water = -1
sugar = -1
concentration = -1

for i in range(F//(A*100)+1):
    for j in range((F-A*100*i)//(B*100)+1):
        for k in range((F-A*i*100-B*100*j)//C+1):
            for l in range((F-A*i*100-B*100*j-C*k)//D+1):
                x = i * A + j * B
                y = k * C + l * D
                if x == 0:
                    continue
                if x * E >= y and concentration < (100 * y)/(x*100+y):
                    sugar_water = 100 * x + y
                    sugar = y
                    concentration = (100 * y)/(x*100+y)

print(sugar_water,sugar)

Buggy python submission (verdict: Time Limit Exceeded):
A, B, C, D, E, F = map(int, input().split())

sugar_water = -1
sugar = -1
concentration = -1

A = 100*A
B = 100*B
max_sugar = (F//100) * E

for a in range(0,F+1,A):
    for b in range(0,F-a+1,B):
        for c in range(0,max_sugar + 1,C):
            for d in range(0,max_sugar-c+1,D):
                tmp_sugar_water = a + b + c + d
                if tmp_sugar_water == 0:
                    continue
                tmp_concentration = 100 * (c + d) / (tmp_sugar_water)
                if tmp_sugar_water <= F and tmp_concentration <= (100 * E) / (100 + E):
                    if tmp_concentration == (100 * E) / (100 + E):
                        concentration = tmp_concentration
                        sugar_water = tmp_sugar_water
                        sugar = c + d
                        break
                    if concentration < tmp_concentration:
                        concentration = tmp_concentration
                        sugar_water = tmp_sugar_water
                        sugar = c + d

print(sugar_water,sugar)

Fixed submission:
A, B, C, D, E, F = map(int, input().split())

sugar_water = -1
sugar = -1
concentration = -1

for i in range(F//(A*100)+1):
    for j in range((F-A*100*i)//(B*100)+1):
        for k in range((F-A*i*100-B*100*j)//C+1):
            for l in range((F-A*i*100-B*100*j-C*k)//D+1):
                x = i * A + j * B
                y = k * C + l * D
                if x == 0:
                    continue
                if x * E >= y and concentration < (100 * y)/(x*100+y):
                    sugar_water = 100 * x + y
                    sugar = y
                    concentration = (100 * y)/(x*100+y)

print(sugar_water,sugar)

Buggy python submission (verdict: Time Limit Exceeded):
A, B, C, D, E, F = map(int, input().split())

sugar_water = -1
sugar = -1
concentration = -1

A = 100*A
B = 100*B
max_sugar = (F//100) * E

for a in range(0,F+1,A):
    for b in range(0,F-a+1,B):
        for c in range(0,max_sugar + 1,C):
            for d in range(0,max_sugar-c+1,D):
                tmp_sugar_water = a + b + c + d
                if tmp_sugar_water == 0:
                    continue
                tmp_concentration = 100 * (c + d) / (tmp_sugar_water)
                if tmp_sugar_water <= F and tmp_concentration <= (100 * E) / (100 + E):
                    if concentration < tmp_concentration:
                        concentration = tmp_concentration
                        sugar_water = tmp_sugar_water
                        sugar = c + d

print(sugar_water,sugar)

Fixed submission:
A, B, C, D, E, F = map(int, input().split())

sugar_water = -1
sugar = -1
concentration = -1

for i in range(F//(A*100)+1):
    for j in range((F-A*100*i)//(B*100)+1):
        for k in range((F-A*i*100-B*100*j)//C+1):
            for l in range((F-A*i*100-B*100*j-C*k)//D+1):
                x = i * A + j * B
                y = k * C + l * D
                if x == 0:
                    continue
                if x * E >= y and concentration < (100 * y)/(x*100+y):
                    sugar_water = 100 * x + y
                    sugar = y
                    concentration = (100 * y)/(x*100+y)

print(sugar_water,sugar)