Problem p03599 (python)

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

# 100A,100B の水
for a in range(1 + F // 100):
    for b in range(1 + F // 100):
        water = 100 * (a * A + b * B)
        if 0 < water <= F:
            W.append(water)

# c,d の砂糖
for c in range(1 + F // C):
    for d in range(1 + F // D):
        sugar = c * C + d * D
        if sugar <= F:
            S.append(sugar)

W = list(set(W))
S = list(set(S))

x = -1
for w in W:
    for s in S:
        if w + s <= F:
            sol = 100 * s / w
            if x < sol <= E:
                x = sol
                X, Y = w + s, s

print(X,Y)

Buggy submission (verdict: Runtime Error):
A,B,C,D,E,F = map(int,input().split())
W = []
S = []

# 100A,100B の水
for a in range(1 + F // 100):
    for b in range(1 + F // 100):
        water = 100 * (a * A + b * B)
        if 0 < water <= F:
            W.append(water)

# c,d の砂糖
for c in range(1 + F // C):
    for d in range(1 + F // D):
        sugar = c * C + d * D
        if 0 < sugar <= F:
            S.append(sugar)

W = list(set(W))
S = list(set(S))

x = -1
for w in W:
    for s in S:
        if w + s <= F:
            sol = 100 * s / w
            if x < sol <= E:
                x = sol
                X, Y = w + s, s

print(X,Y)

Buggy submission (verdict: Runtime Error):
A,B,C,D,E,F = map(int,input().split())
W = []
S = []

# 100A,100B の水
for a in range(1 + F // 100):
    for b in range(1 + F // 100):
        water = 100 * (a * A + b * B)
        if 0 < water <= F:
            W.append(water)

# c,d の砂糖
for c in range(1 + F // C):
    for d in range(1 + F // D):
        sugar = c * C + d * D
        if 0 < sugar <= F:
            S.append(sugar)

W = list(set(W))
S = list(set(S))

x = -1
for w in W:
    for s in S:
        if w + s <= F:
            sol = 100 * s / w
            if x <= sol <= E:
                x = sol
                X, Y = w + s, s

print(X,Y)

Buggy submission (verdict: Runtime Error):
A,B,C,D,E,F = map(int,input().split())
W = []
S = []

# 100A,100B の水
for a in range(1 + F // 100):
    for b in range(1 + F // 100):
        water = 100 * (a * A + b * B)
        if 0 < water <= F:
            W.append(water)

# c,d の砂糖
for c in range(1 + F // C):
    for d in range(1 + F // D):
        sugar = c * C + d * D
        if 0 < sugar <= F:
            S.append(sugar)

W = list(set(W))
S = list(set(S))

x = 0
for w in W:
    for s in S:
        if w + s <= F:
            sol = 100 * s / w
            if x < sol <= E:
                x = sol
                X, Y = w + s, s

print(X,Y)

Buggy submission (verdict: Runtime Error):
A,B,C,D,E,F = map(int,input().split())
M = []
S = []

# 100A,100B の水
for a in range(1 + F // 100):
    for b in range(1 + F // 100):
        water = 100 * (a * A + b * B)
        if 0 < water <= F:
            M.append(water)

# c,d の砂糖
for c in range(1 + F // C):
    for d in range(1 + F // D):
        sugar = c * C + d * D
        if 0 < sugar <= F:
            S.append(sugar)

M=list(set(M))
S=list(set(S))
# M.sort()
# S.sort()
#print(M,S)

x = 0
for m in M:
  for s in S:
    if m != 0 and m + s <= F:
        sol = 100 * s / m
        if sol > x and sol <= E:
            x = sol
            X, Y = m + s, s

print(X,Y)

Buggy submission (verdict: Runtime Error):
A,B,C,D,E,F = map(int,input().split())
M = []
S = []

# 100A,100B の水
for a in range(1 + F // 100):
    for b in range(1 + F // 100):
        if 100 * (a * A + b * B) <= F:
            M.append(100 * (a * A + b * B))

# c,d の砂糖
for c in range(1 + F // C):
    for d in range(1 + F // D):
        if c * C + d * D <= F:
            S.append(c * C + d * D)

M=list(set(M))
S=list(set(S))
M.sort()
S.sort()

x = 0
for m in M:
  for s in S:
    if m != 0 and m + s <= F:
        sol = 100 * s / m
        if sol > x and sol <= E:
            x = sol
            X, Y = m + s, s

print(X,Y)

Buggy submission (verdict: Runtime Error):
A,B,C,D,E,F = map(int,input().split())
M = []
S = []

# 100A,100B の水
for a in range(1 + F // 100):
    for b in range(1 + F // 100):
        if 100 * (a * A + b * B) <= F:
            M.append(100 * (a * A + b * B))

# c,d の砂糖
for c in range(1 + F // C):
    for d in range(1 + F // D):
        if c * C + d * D <= F:
            S.append(c * C + d * D)

M=list(set(M))
S=list(set(S))
M.sort()
S.sort()

x = 0
for m in M:
  for s in S:
    if m != 0 and s != 0 and m + s <= F:
        sol = 100 * s / m
        if sol > x and sol <= E:
            x = sol
            X, Y = m + s, s

print(X,Y)

Buggy submission (verdict: Runtime Error):
A,B,C,D,E,F = map(int,input().split())
M = []
S = []
 
for a in range(1+F//100):
    for b in range(1+F//100):
        if 100*(a*A+b*B)<=F:
            M.append(100*(a*A+b*B))

for c in range(1+F//C):
    for d in range(1+F//D):
        if c*C+d*D<=F:
            S.append(c*C+d*D)

M=list(set(M))
S=list(set(S))
M.sort()
S.sort()
#print(M,S)

x = 0
for m in M:
  for s in S:
    if m != 0 and s != 0 and m+s <= F:
      sol = 100 * s / m
      if sol > x and sol <= E:
        x = sol
        X,Y = m+s,s
      
print(X,Y)