distance = [3, 2, 4]
price = [4, 5, 2, 6]

min_price = price[0]
answer = 0

for i in range(len(distance)):
    if price[i] < min_price:
        min_price = price[i]
    answer += min_price * distance[i]

print(answer)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: