solutions: 230A

This commit is contained in:
Muhammad Nauman Raza 2025-01-14 22:52:41 +00:00
parent 8de993c32d
commit b05eee28b1
Signed by: devraza
GPG key ID: 91EAD6081011574B

18
solutions/230A.py Normal file
View file

@ -0,0 +1,18 @@
import sys
s, n = [int(d) for d in input().split(' ')]
dragons = []
for _ in range(n):
dragons.append([int(d) for d in input().split(' ')])
dragons = sorted(dragons, key=lambda x: x[0])
for i in dragons:
if s > i[0]:
s += i[1]
else:
print("NO")
sys.exit()
print("YES")