题解 | 小红的优惠券
小红的优惠券
https://www.nowcoder.com/practice/8235baca28854e15b68a47a17d817929
a,b = map(int,input().split(" "))
rev = a
ans = a
for i in range(b):
a = rev
c,d = map(int,input().split(" "))
if a >=c:
a -= d
else: continue
ans = min(ans,a)
print(ans)
