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

[백준/파이썬] 9253번 Negative People in Da House

by 현장 2024. 8. 8.

-Code

for _ in range(int(input())):
    res, now = 0, 0
    for _ in range(int(input())):
        p1, p2 = map(int, input().split())
        now = now - p1 + p2
        res = max(res, now)
    print(res)