-Code
res = []
n, x = map(int, input().split())
for _ in range(n):
s, t = map(int, input().split())
if s + t <= x:
res.append(s)
print(sorted(res)[-1] if len(res) > 0 else -1)
'Beakjoon&프로그래머스 > 파이썬' 카테고리의 다른 글
[백준/파이썬] 27130번 Long Multiplication (0) | 2024.06.20 |
---|---|
[백준/파이썬] 31994번 강당 대관 (0) | 2024.06.19 |
[백준/파이썬] 19963번 Санта Клаус (0) | 2024.06.17 |
[백준/파이썬] 30215번 Age Expression (0) | 2024.06.16 |
[백준/파이썬] 13456번 Richard Hamming (1) | 2024.06.15 |