Buggy python submission (verdict: Time Limit Exceeded):
import math
a,b,c,d,e,f = map(int,input().split())
max_sugar = f*e*100/(100+e)
box = {}
for i in range(31):
  for j in range(31):
    water = 100*a*i + 100*b*j
    if water > f:
      break
    sugar_range = int(math.ceil(max_sugar/c))
    for k in range(sugar_range):
      for l in range(sugar_range):
        sugar = c*k + d*l
        if sugar > max_sugar:
          break
        amount = water + sugar
        if amount == 0:
          break
        conc = 100*sugar / amount
        if amount <= f and conc <= e*100/(100+e):
          box[conc] = [amount,sugar]
answer = max(box.items(),key = lambda x:x[0])[1]
print(str(answer[0]) + " " +str(answer[1]))

Fixed submission:
import math
a,b,c,d,e,f = map(int,input().split())
max_nodo = e/(e+100)
answer = {}
for i in range(31):
  for j in range(31):
    water = 100*a*i + 100*b*j
    max_sugar = water*e/100
    sugar_range = int(math.ceil(max_sugar/c))
    if water >= f:
      break
    for k in range(sugar_range):
      for l in range(sugar_range):
        sugar = c*k + d*l
        total = water + sugar
        nodo = sugar / total
        if total > f:
          break
        if sugar > max_sugar:
          break
        answer[nodo] = [total,sugar]
ans = max(answer.items(),key = lambda x:x[0])[1]

#print(answer)
print(str(ans[0]) + " " + str(ans[1]))

Buggy python submission (verdict: Runtime Error):
import math
a,b,c,d,e,f = map(int,input().split())
max_sugar = f*e*100/(100+e)
box = {}
for i in range(31):
  for j in range(31):
    water = 100*a*i + 100*b*j
    if water > f:
      break
    sugar_range = int(math.ceil(max_sugar/c))
    for k in range(sugar_range):
      for l in range(sugar_range):
        sugar = c*k + d*l
        if sugar > max_sugar:
          break
        amount = water + sugar
        if amount > f or amount == 0
          break
        conc = 100*sugar / amount
        if conc <= e*100/(100+e):
          box[conc] = [amount,sugar]
answer = max(box.items(),key = lambda x:x[0])[1]
print(str(answer[0]) + " " +str(answer[1]))

Fixed submission:
import math
a,b,c,d,e,f = map(int,input().split())
max_nodo = e/(e+100)
answer = {}
for i in range(31):
  for j in range(31):
    water = 100*a*i + 100*b*j
    max_sugar = water*e/100
    sugar_range = int(math.ceil(max_sugar/c))
    if water >= f:
      break
    for k in range(sugar_range):
      for l in range(sugar_range):
        sugar = c*k + d*l
        total = water + sugar
        nodo = sugar / total
        if total > f:
          break
        if sugar > max_sugar:
          break
        answer[nodo] = [total,sugar]
ans = max(answer.items(),key = lambda x:x[0])[1]

#print(answer)
print(str(ans[0]) + " " + str(ans[1]))

Buggy python submission (verdict: Time Limit Exceeded):
import math
a,b,c,d,e,f = map(int,input().split())
max_sugar = f*e*100/(100+e)
box = {}
for i in range(31):
  for j in range(31):
    water = 100*a*i + 100*b*j
    if water > f:
      break
    sugar_range = math.ceil(max_sugar/c)
    for k in range(sugar_range):
      for l in range(sugar_range):
        sugar = c*k + d*l
        if sugar > max_sugar:
          break
        amount = water + sugar
        if amount == 0:
          break
        conc = 100*sugar / amount
        if amount <= f and conc <= e*100/(100+e):
          box[conc] = [amount,sugar]
answer = max(box.items(),key = lambda x:x[0])[1]
print(str(answer[0]) + " " +str(answer[1]))

Fixed submission:
import math
a,b,c,d,e,f = map(int,input().split())
max_nodo = e/(e+100)
answer = {}
for i in range(31):
  for j in range(31):
    water = 100*a*i + 100*b*j
    max_sugar = water*e/100
    sugar_range = int(math.ceil(max_sugar/c))
    if water >= f:
      break
    for k in range(sugar_range):
      for l in range(sugar_range):
        sugar = c*k + d*l
        total = water + sugar
        nodo = sugar / total
        if total > f:
          break
        if sugar > max_sugar:
          break
        answer[nodo] = [total,sugar]
ans = max(answer.items(),key = lambda x:x[0])[1]

#print(answer)
print(str(ans[0]) + " " + str(ans[1]))

Buggy python submission (verdict: Time Limit Exceeded):
import math
a,b,c,d,e,f = map(int,input().split())
max_sugar = f*e*100/(100+e)
box = {}
for i in range(31):
  for j in range(31):
    water = 100*a*i + 100*b*j
    if water > f:
      break
    for k in range(math.ceil(max_sugar/c)):
      for l in range(math.ceil(max_sugar/d)):
        sugar = c*k + d*l
        if sugar > max_sugar:
          break
        amount = water + sugar
        if amount == 0:
          break
        conc = 100*sugar / amount
        if amount <= f and conc <= e*100/(100+e):
          box[conc] = [amount,sugar]
answer = max(box.items(),key = lambda x:x[0])[1]
print(str(answer[0]) + " " +str(answer[1]))

Fixed submission:
import math
a,b,c,d,e,f = map(int,input().split())
max_nodo = e/(e+100)
answer = {}
for i in range(31):
  for j in range(31):
    water = 100*a*i + 100*b*j
    max_sugar = water*e/100
    sugar_range = int(math.ceil(max_sugar/c))
    if water >= f:
      break
    for k in range(sugar_range):
      for l in range(sugar_range):
        sugar = c*k + d*l
        total = water + sugar
        nodo = sugar / total
        if total > f:
          break
        if sugar > max_sugar:
          break
        answer[nodo] = [total,sugar]
ans = max(answer.items(),key = lambda x:x[0])[1]

#print(answer)
print(str(ans[0]) + " " + str(ans[1]))

Buggy python submission (verdict: Time Limit Exceeded):
import math
a,b,c,d,e,f = map(int,input().split())
max_sugar = f*e*100/(100+e)
box = {}
for i in range(31):
  for j in range(31):
    water = 100*a*i + 100*b*j
    if water > f:
      break
    sugar_range = math.ceil(max_sugar/c)
    for k in range(sugar_range):
      for l in range(sugar_range):
        sugar = c*k + d*l
        if sugar > max_sugar:
          break
        amount = water + sugar
        if amount == 0:
          break
        conc = 100*sugar / amount
        if amount <= f and conc <= e*100/(100+e):
          box[conc] = [amount,sugar]
new_box = sorted(box.items(),reverse = True)
print(str(new_box[0][1][0]) + " " +str(new_box[0][1][1]))

Fixed submission:
import math
a,b,c,d,e,f = map(int,input().split())
max_nodo = e/(e+100)
answer = {}
for i in range(31):
  for j in range(31):
    water = 100*a*i + 100*b*j
    max_sugar = water*e/100
    sugar_range = int(math.ceil(max_sugar/c))
    if water >= f:
      break
    for k in range(sugar_range):
      for l in range(sugar_range):
        sugar = c*k + d*l
        total = water + sugar
        nodo = sugar / total
        if total > f:
          break
        if sugar > max_sugar:
          break
        answer[nodo] = [total,sugar]
ans = max(answer.items(),key = lambda x:x[0])[1]

#print(answer)
print(str(ans[0]) + " " + str(ans[1]))

Buggy python submission (verdict: Time Limit Exceeded):
import math
a,b,c,d,e,f = map(int,input().split())
max_sugar = f*e*100/(100+e)
box = {}
for i in range(31):
  for j in range(31):
    water = 100*a*i + 100*b*j
    if water > f:
      break
    for k in range(math.ceil(max_sugar/c)):
      for l in range(math.ceil(max_sugar/d)):
        sugar = c*k + d*l
        if sugar > max_sugar:
          break
        amount = water + sugar
        if amount == 0:
          break
        conc = 100*sugar / amount
        if amount <= f and conc <= e*100/(100+e):
          box[conc] = [amount,sugar]
new_box = sorted(box.items(),reverse = True)
print(str(new_box[0][1][0]) + " " +str(new_box[0][1][1]))

Fixed submission:
import math
a,b,c,d,e,f = map(int,input().split())
max_nodo = e/(e+100)
answer = {}
for i in range(31):
  for j in range(31):
    water = 100*a*i + 100*b*j
    max_sugar = water*e/100
    sugar_range = int(math.ceil(max_sugar/c))
    if water >= f:
      break
    for k in range(sugar_range):
      for l in range(sugar_range):
        sugar = c*k + d*l
        total = water + sugar
        nodo = sugar / total
        if total > f:
          break
        if sugar > max_sugar:
          break
        answer[nodo] = [total,sugar]
ans = max(answer.items(),key = lambda x:x[0])[1]

#print(answer)
print(str(ans[0]) + " " + str(ans[1]))

Buggy python submission (verdict: Runtime Error):
import math
a,b,c,d,e,f = map(int,input().split())
water_nodo = 100 /(100 + e)
water_max = f*water_nodo
a_max = math.ceil(water_max / (100*a))
b_max = math.ceil(water_max / (100*b))
water_gaps = []
for i in range(a_max):
  for j in range(b_max):
    water_gap = water_max - 100*a*i - 100*b*j
    if water_gap >= 0:
      water_gaps.append(water_gap)
sorted_water = sorted(water_gaps)
max_water = water_max - sorted_water[0]
sugar_max = max_water*e/100
c_max = math.ceil(sugar_max / c)
d_max = math.ceil(sugar_max / d)
sugar_gaps = []
for k in range(c_max):
  for l in range(d_max):
    sugar_gap = sugar_max - c*k - d*l
    if sugar_gap >= 0:
      sugar_gaps.append(sugar_gap)
sorted_sugar = sorted(sugar_gaps)
max_sugar = sugar_max - sorted_sugar[0]
print(str(int(max_water + max_sugar)) + " " + str(int(max_sugar)))

Fixed submission:
import math
a,b,c,d,e,f = map(int,input().split())
max_nodo = e/(e+100)
answer = {}
for i in range(31):
  for j in range(31):
    water = 100*a*i + 100*b*j
    max_sugar = water*e/100
    sugar_range = int(math.ceil(max_sugar/c))
    if water >= f:
      break
    for k in range(sugar_range):
      for l in range(sugar_range):
        sugar = c*k + d*l
        total = water + sugar
        nodo = sugar / total
        if total > f:
          break
        if sugar > max_sugar:
          break
        answer[nodo] = [total,sugar]
ans = max(answer.items(),key = lambda x:x[0])[1]

#print(answer)
print(str(ans[0]) + " " + str(ans[1]))

Buggy python submission (verdict: Runtime Error):
import math
a,b,c,d,e,f = map(int,input().split())
water_nodo = 100 /(100 + e)
water_max = f*water_nodo
a_max = math.ceil(water_max / (100*a))
b_max = math.ceil(water_max / (100*b))
water_gaps = []
for i in range(a_max):
  for j in range(b_max):
    water_gap = water_max - 100*a*i - 100*b*j
    if water_gap >= 0:
      water_gaps.append(water_gap)
sorted_water = sorted(water_gaps)
max_water = water_max - sorted_water[0]
sugar_max = max_water*e/100
c_max = math.ceil(sugar_max / c)
d_max = math.ceil(sugar_max / d)
sugar_gaps = []
for k in range(c_max):
  for l in range(d_max):
    sugar_gap = sugar_max - c*k - d*l
    if sugar_gap >= 0:
      sugar_gaps.append(sugar_gap)
sorted_sugar = sorted(sugar_gaps)
max_sugar = sugar_max - sorted_sugar[0]
print(str(int(max_water + max_sugar)) + " " + str(int(max_sugar)))

Fixed submission:
import math
a,b,c,d,e,f = map(int,input().split())
max_nodo = e/(e+100)
answer = {}
for i in range(31):
  for j in range(31):
    water = 100*a*i + 100*b*j
    max_sugar = water*e/100
    sugar_range = int(math.ceil(max_sugar/c))
    if water >= f:
      break
    for k in range(sugar_range):
      for l in range(sugar_range):
        sugar = c*k + d*l
        total = water + sugar
        nodo = sugar / total
        if total > f:
          break
        if sugar > max_sugar:
          break
        answer[nodo] = [total,sugar]
ans = max(answer.items(),key = lambda x:x[0])[1]

#print(answer)
print(str(ans[0]) + " " + str(ans[1]))