Buggy python submission (verdict: Runtime Error):
import sys

a, b, c, d, e, f = map(int, input().split())

water_pattern = []
for i in range(f+1):
    for j in range(f+1):
        x = a*i*100 + b*j*100
        if x <= f and not x in water_pattern:
            water_pattern.append(x)

sugar_pattern = []
for i in range(f+1):
    for j in range(f+1):
        y = c*i + d*j
        if y <= f and not y in sugar_pattern:
            sugar_pattern.append(y)

sugarwater_max = -1
sugar_max = -1
concentration = 0
for i in range(len(water_pattern)):
    for j in range(len(sugar_pattern)):
        # if i == 0 and j == 0:
        #     continue
        # else:
        #     sugarwater = water_pattern[i] + sugar_pattern[j]
        #     if (water_pattern[i]/100) * e >= sugar_pattern[j] and sugarwater <= f:
        #         if sugarwater_max == -1 and sugar_max == -1:
        #             sugarwater_max = sugarwater
        #             sugar_max = sugar_pattern[j]
        #             concentration = 100 * sugar_pattern[j] / sugarwater
        #         else:
        #             if concentration < 100 * sugar_pattern[j] / sugarwater:
        #                 sugarwater_max = sugarwater
        #                 sugar_max = sugar_pattern[j]
        #                 concentration = 100 * sugar_pattern[j] / sugarwater

print("{} {}".format(sugarwater_max, sugar_max))

Fixed submission:
# ABC074C - Sugar Water
# input
a, b, c, d, e, f = list(map(int, input().rstrip().split()))
A = a * 100
B = b * 100

# default values
x, y = min(a, b) * 100, 0  # density could be 0%
dens = y / x


# exhaustive search
for i in range(f // A + 1):
    for j in range(((f - A * i) // B) + 1):
        if i == 0 and j == 0:
            continue
        water = i * A + j * B
        rest = f - water
        for k in range(rest // c + 1):
            for l in range((rest - c * k) // d + 1):
                sugar = c * k + d * l
                total = water + sugar

                if sugar / total > e / (e + 100):  # compare to e (the max density)
                    break
                else:
                    if sugar / total > dens:
                        dens = sugar / total
                        x, y = total, sugar
print(x, y)

Buggy python submission (verdict: Time Limit Exceeded):
import sys

a, b, c, d, e, f = map(int, input().split())

water_pattern = []
for i in range(f+1):
    for j in range(f+1):
        x = a*i*100 + b*j*100
        if x <= f and not x in water_pattern:
            water_pattern.append(x)

sugar_pattern = []
for i in range(f+1):
    for j in range(f+1):
        y = c*i + d*j
        if y <= f and not y in sugar_pattern:
            sugar_pattern.append(y)

sugarwater_max = -1
sugar_max = -1
concentration = 0
for i in range(len(water_pattern)):
    for j in range(len(sugar_pattern)):
        if i == 0 and j == 0:
            continue
        else:
            sugarwater = water_pattern[i] + sugar_pattern[j]
            if (water_pattern[i]/100) * e >= sugar_pattern[j] and sugarwater <= f:
                if sugarwater_max == -1 and sugar_max == -1:
                    sugarwater_max = sugarwater
                    sugar_max = sugar_pattern[j]
                    concentration = 100 * sugar_pattern[j] / sugarwater
                else:
                    if concentration < 100 * sugar_pattern[j] / sugarwater:
                        sugarwater_max = sugarwater
                        sugar_max = sugar_pattern[j]
                        concentration = 100 * sugar_pattern[j] / sugarwater

print("{} {}".format(sugarwater_max, sugar_max))

Fixed submission:
# ABC074C - Sugar Water
# input
a, b, c, d, e, f = list(map(int, input().rstrip().split()))
A = a * 100
B = b * 100

# default values
x, y = min(a, b) * 100, 0  # density could be 0%
dens = y / x


# exhaustive search
for i in range(f // A + 1):
    for j in range(((f - A * i) // B) + 1):
        if i == 0 and j == 0:
            continue
        water = i * A + j * B
        rest = f - water
        for k in range(rest // c + 1):
            for l in range((rest - c * k) // d + 1):
                sugar = c * k + d * l
                total = water + sugar

                if sugar / total > e / (e + 100):  # compare to e (the max density)
                    break
                else:
                    if sugar / total > dens:
                        dens = sugar / total
                        x, y = total, sugar
print(x, y)

Buggy python submission (verdict: Time Limit Exceeded):
import sys

a, b, c, d, e, f = map(int, input().split())

water_pattern = []
for i in range(f+1):
    for j in range(f+1):
        x = a*i*100 + b*j*100
        if x <= f:
            water_pattern.append(x)

sugar_pattern = []
for i in range(f+1):
    for j in range(f+1):
        y = c*i + d*j
        if y <= f:
            sugar_pattern.append(y)

sugarwater_max = -1
sugar_max = -1
concentration = 0
for i in range(len(water_pattern)):
    for j in range(len(sugar_pattern)):
        if i == 0 and j == 0:
            continue
        else:
            sugarwater = water_pattern[i] + sugar_pattern[j]
            if (water_pattern[i]/100) * e >= sugar_pattern[j] and sugarwater <= f:
                if sugarwater_max == -1 and sugar_max == -1:
                    sugarwater_max = sugarwater
                    sugar_max = sugar_pattern[j]
                    concentration = 100 * sugar_pattern[j] / sugarwater
                else:
                    if concentration < 100 * sugar_pattern[j] / sugarwater:
                        sugarwater_max = sugarwater
                        sugar_max = sugar_pattern[j]
                        concentration = 100 * sugar_pattern[j] / sugarwater

print("{} {}".format(sugarwater_max, sugar_max))

Fixed submission:
# ABC074C - Sugar Water
# input
a, b, c, d, e, f = list(map(int, input().rstrip().split()))
A = a * 100
B = b * 100

# default values
x, y = min(a, b) * 100, 0  # density could be 0%
dens = y / x


# exhaustive search
for i in range(f // A + 1):
    for j in range(((f - A * i) // B) + 1):
        if i == 0 and j == 0:
            continue
        water = i * A + j * B
        rest = f - water
        for k in range(rest // c + 1):
            for l in range((rest - c * k) // d + 1):
                sugar = c * k + d * l
                total = water + sugar

                if sugar / total > e / (e + 100):  # compare to e (the max density)
                    break
                else:
                    if sugar / total > dens:
                        dens = sugar / total
                        x, y = total, sugar
print(x, y)