백준 15720번: 카우버거 #Python

ColorlessDia·2024년 8월 30일

algorithm/baekjoon

목록 보기
285/808
B, C, D = map(int, input().split())

burger = sorted(map(int, input().split()), reverse=True)
side = sorted(map(int, input().split()), reverse=True)
drink = sorted(map(int, input().split()), reverse=True)

total_price = 0
sale_price = 0

count = min(B, C, D)

sale_menu = burger[:count] + side[:count] + drink[:count]
menu = burger[count:] + side[count:] + drink[count:]

for price in sale_menu:
    total_price += price
    sale_price += int(price * 0.9)

for price in menu:
    total_price += price
    sale_price += price

print(total_price)
print(sale_price)

0개의 댓글