The first line is two positive integers a, n, a, representing the initial damage, n represents the number of dragon,
Then n lines, each line contains two positive integers x, y, x represents the dragon fire damage, y represent the dragon bonus fire damage to
The size of the data within 1000,
If you can customs clearance, output YES; Otherwise the output NO, don't break,
CodePudding user response:
Throw brick:In descending order of y, then start from scratch every time to find the first soft persimmon bullying,