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

[백준/파이썬] 11434번 Ampelmännchen

by 현장 2024. 8. 9.

-Code

for t in range(int(input())):
    n, w, e = map(int, input().split())
    res = 0

    for _ in range(n):
        ww, we, ew, ee = map(int, input().split())
        res += max(w * ww + e * ew, w * we + e * ee)

    print(f"Data Set {t + 1}:")
    print(res)
    print()