Beakjoon&프로그래머스/파이썬

[백준/파이썬] 26933번 Receptet

현장 2023. 2. 25. 13:35

-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)