diff --git a/solutions/230A.py b/solutions/230A.py new file mode 100644 index 0000000..ab7529d --- /dev/null +++ b/solutions/230A.py @@ -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")