第三个测试点2非零返回是因为,月饼数量和价格有可能是浮点数,不能用整数存储。
if __name__ == '__main__':
n, need = input().split()
numbers = input().split()
prices = input().split()
price = [(float(numbers[i]), float(prices[i]) / float(numbers[i])) for i in range(int(n))]
price = sorted(price, key=lambda x: x[1], reverse=True)
s = 0.0
for i in price:
if float(need) < i[0]:
s += i[1] * float(need)
break
s += i[1] * i[0]
need = str(float(need) - i[0])
print("%.2f" % s)