Problem p03599 (python)

Fixed submission:
a,b,c,d,e,f=map(int,input().split())
aa=-1
ans=[0,0]
for i in range(0,f+1,a*100):
  for j in range(0,f+1-i,b*100):
    for k in range(0,int(e*(i+j)/100)+1,c):
      for l in range(0,int(e*(i+j)/100)+1-k,d):
        if i+j+k+l>f:
          continue
        if i+j>0 and aa<(k+l)/(i+j+k+l):
          aa=(k+l)/(i+j+k+l)
          ans=[i+j+k+l,k+l]
print(ans[0],ans[1])

Buggy submission (verdict: Runtime Error):
a,b,c,d,e,f=map(int,input().split())
aa=0
ans=[0,0]
for i in range(0,f+1,a*100):
  for j in range(0,f+1-i,b*100):
    for k in range(0,e*(i+j)/100+1,c):
      for l in range(0,e*(i+j)/100+1-k,d):
        if i+j+k+l>f:
          continue
        if i+j>0 and aa<100*(k+l)/(i+j):
          aa=100*(k+l)/(i+j)
          ans=[i+j+k+l,k+l]
print(ans[0],ans[1])

Buggy submission (verdict: Runtime Error):
a,b,c,d,e,f=map(int,input().split())
aa=0
ans=[0,0]
for i in range(0,f+1,a*100):
  for j in range(0,f+1-i,b*100):
    for k in range(0,e*(i+j)/100+1,c):
      for l in range(0,e*(i+j)/100+1-k,d):
        if i+j+k+l>f:
          continue
        if i+j>0 and aa<(k+l)/(i+j+k+l):
          aa=(k+l)/(i+j+k+l)
          ans=[i+j+k+l,k+l]
print(ans[0],ans[1])

Buggy submission (verdict: Runtime Error):
a,b,c,d,e,f=map(int,input().split())
k=0
ans=[0,0]
for i in range(0,f+1,a*100):
  for j in range(0,f+1-i,b*100):
    for k in range(0,e*(i+j)//100+1,c):
      for l in range(0,e*(i+j)//100+1-k,d):
        if i+j+k+l>f:
          continue
        if k<(k+j)/(i+j) and i+j>0:
          k=(k+j)/(i+j)
          ans=[i+j+k+l,k+l]
print(ans[0],ans[1])

Buggy submission (verdict: Runtime Error):
a,b,c,d,e,f=map(int,input().split())
k=0
ans=[0,0]
for i in range(0,f+1,a*100):
  for j in range(0,f+1-i,b*100):
    for k in range(0,e*(i+j)//100+1,c):
      for l in range(0,e*(i+j)//100+1-k,d):
        if i+j+k+l>f:
          continue
        if k<(k+j)/(i+j):
          k=(k+j)/(i+j)
          ans=[i+j+k+l,k+l]
print(ans[0],ans[1])

Buggy submission (verdict: Runtime Error):
a,b,c,d,e,f=map(int,input().split())
a=0
ans=[0,0]
for i in range(0,f+1,a*100):
  for j in range(0,f+1-i,b*100):
    for k in range(0,e*(i+j)//100+1,c):
      for l in range(0,e*(i+j)//100+1-k,d):
        if i+j+k+l>f:
          continue
        if a<(k+j)/(i+j):
          a=(k+j)/(i+j)
          ans=[i+j+k+l,k+l]
print(ans[0],ans[1])

Buggy submission (verdict: Runtime Error):
a,b,c,d,e,f=map(int,input().split())
f//=100
a=0
ans=[0,0]
for i in range(0,f+1,a):
  for j in range(0,f+1-i,b):
    for k in range(0,e*(i+j)+1,c):
      for l in range(0,e*(i+j)+1-k,d):
        if i+j+k+l>f:
          continue
        if a<(k+j)/(i+j):
          a=(k+j)/(i+j)
          ans=[i+j+k+l,k+l]
print(ans[0],ans[1])

Buggy submission (verdict: Runtime Error):
a,b,c,d,e,f=map(int,input().split())
q=[[0,0]]
k=0
ans=0
while len(q)>0:
  x,y=q.pop()
  if x!=0 and y/(x+y)>k:
    k=y/(x+y)
    ans=[x,y]
  if x+y+100*a<=f:
    q+=[[x+100*a,y]]
  if x+y+100*b<=f:
    q+=[[x+100*b,y]]
  if y+c<=(x-y)*e/100 and x+y+c<=f:
    q+=[[x+c,y+c]]
  if y+d<=(x-y)*e/100 and x+y+d<=f:
    q+=[[x+d,y+d]]
print(ans[0],ans[1])

Buggy submission (verdict: Runtime Error):
a,b,c,d,e,f=map(int,input().split())
q=[[0,0]]
k=0
ans=0
while len(q)>0:
  x,y=q.pop()
  if x/(x+y)>k:
    k=x/(x+y)
    ans=[x,y]
  if x+y+100*a<=f:
    q+=[[x+100*a,y]]
  if x+y+100*b<=f:
    q+=[[x+100*b,y]]
  if y+c<=(x-y)*e/100 and x+y+c<=f:
    q+=[[x+c,y+c]]
  if y+d<=(x-y)*e/100 and x+y+d<=f:
    q+=[[x+d,y+d]]
print(ans[0],ans[1])

Buggy submission (verdict: Runtime Error):
a,b,c,d,e,f=map(int,input().split())
q=[[0,0]]
k=0
ans=0
while len(q)>0:
  x,y=q.pop()
  if x/(x+y)>k:
    k=x/(x+y)
    ans=[x,y]
  if x+y+100*a<=f:
    q+=[[x+100*a,y]]
  if x+y+100*b<=f:
    q+=[[x+100*b,y]]
  if y+c<=(x-y)*e/100 and x+y+c<=f:
    q+=[[x+c,y+c]]
  if y+d<=(x-y)*e/100 and x+y+d<=f:
    q+=[[x+d,y+d]]
print(ans[0],ans[1])

Buggy submission (verdict: Runtime Error):
a,b,c,d,e,f=map(int,input().split())
q=[[0,0]]
ans=0
while len(q)>0:
  x,y=pop(q)
  if x+y+100*a<=f:
    q+=[[x+100*a,y]]
  if x+y+100*b<=f:
    q+=[[x+100*b,y]]
  if y+c<=(x-y)*e/100 and x+y+c<=f:
    q+=[[x+c,y+c]]
    ans=max(ans,100*(y+c)/(x+y+c))
  if y+d<=(x-y)*e/100 and x+y+d<=f:
    q+=[[x+d,y+d]]
    ans=max(ans,100*(y+d)/(x+y+d))
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c,d,e,f=map(int,input().split())
q=[[0,0]]
ans=0
while len(q)>0:
  x,y=pop(q)
  if x+y+100*a<=f:
    q.append([x+100*a,y])
  if x+y+100*b<=f:
    q.append([x+100*b,y])
  if y+c<=(x-y)*e/100 and x+y+c<=f:
    q.append([x+c,y+c])
    ans=max(ans,100*(y+c)/(x+y+c))
  if y+d<=(x-y)*e/100 and x+y+d<=f:
    q.append([x+d,y+d])
    ans=max(ans,100*(y+d)/(x+y+d))
print(ans)