Monster Fighting
题号:NC200119
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

In the Game World, we all know the common scene, if you want to make your heroes stronger, you need to defeat monsters and upgrade yourselves.
Little Gyro is also a computer game fan. In a computer game Monster Fighting, Little Gyro need to defeat against n monsters (numbered from 1 to n). Little Gyro's hero has an initial health m. In order to defeat the i-th monster, Little Gyro will lose a_i HP (Health Penalty), However, the monster will drop a blood bottle for Little Gyro to restore d_i HP. During the game of Monster Fighting, your health cannot be reduced to 0 or below.
Given the HP values a_i, d_i for each monster, Little Gyro wants to know whether there exists a certain order that Little Gyro can defeat all the monsters.

输入描述:

There are multiple test cases. The first line of the input contains an integer T, indicating the number of test cases. For each test case:
The first line contains two integers n, m (1 ≤ n, m ≤ ), indicating the number of the monsters and the initial health of Little Gyro's hero.
In the following n lines, each line contains two integers a_i, d_i (1 ≤ a_i, d_i), indicating the HP values that Little Gyro lose and gain when fighting against the i-th monster.
It's guaranteed that the sum of n of all test cases will not exceed .

输出描述:

For each test case, if Little Gyro can defeat all the monsters within a certain order, print "Yes" (without quotes), otherwise, print "No" (without quotes) instead.
示例1

输入

复制
2
3 4
1 2
3 4
4 5
1 1
2 1

输出

复制
Yes
No