n=int(input()) #도시의 개수
km=list(map(int,input().split()))#도로의 길이
price=list(map(int,input().split()))#가격
minPrice=price[0]
total=0
for i in range(n-1):
if minPrice>price[i]:
minPrice=price[i]
total+=(minPrice*km[i])
print(total)
'알고리즘 > 백준' 카테고리의 다른 글
백준-15552번(빠른 A+B)-python3 (0) | 2023.12.01 |
---|---|
백준-13549번(숨바꼭질 3)-python3 (0) | 2023.11.30 |
백준-11866번(요세푸스 문제0)-python3 (0) | 2023.11.30 |
백준-11724번(연결 요소의 개수)-python3 (0) | 2023.11.30 |
백준-11720번(숫자의 합)-python3 (1) | 2023.11.30 |