改了好久还是第三个测试点过不去
没想明白
有大佬知道了可以告诉我嘛
我太菜了
n,d=map(float,input().split())
n=int(n)
store=list(map(float,input().split()))
sell=list(map(float,input().split()))
s={}
i=0
for k in range(n):
if store[i]==0:
m=store.pop(i)
n=sell.pop(i)
i-=1
i+=1
if (len(store)==0):
print("0.00")
else:
for i,j in enumerate(sell):
s[j/store[i]]=(i,j)
k=sorted(s,reverse=True)
income=0
for j in k:
if d>store[s[j][0]]:
d-=store[s[j][0]]
income+=s[j][1]
else:
income+=d*j
break
print("%.2f"%(income))