본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 26933번 Receptet

by 현장 2023. 2. 25.

-Code

n = int(input())
res = 0

for i in range(n):
    h, b, k = map(int, input().split())
    buy = b - h
    if buy > 0:
        res += buy * k

print(res)