이 글은 기존 Tistory 블로그에서 옮겨온 글입니다. 원문: https://jms3084.tistory.com/30

all = int(input())
num = int(input())
for i in range(num):
price, n = map(int, input().split())
all-=price * n
if all == 0:
print(‘Yes’)
else:
print(‘No’)
Research note
all = int(input()) num = int(input()) for i in range(num): price, n = map(int, input().split()) all-=price * n if all == 0: print('Yes') else: print('No')
이 글은 기존 Tistory 블로그에서 옮겨온 글입니다. 원문: https://jms3084.tistory.com/30

all = int(input())
num = int(input())
for i in range(num):
price, n = map(int, input().split())
all-=price * n
if all == 0:
print(‘Yes’)
else:
print(‘No’)