#pragma comment(linker, "/stack:200000000") #pragma GCC optimize("Ofast") #include #define UINT unsigned int #define LL long long int #define ULL unsigned LL #define LD long double #define FI first #define SE second #define PB push_back #define PF push_front #define V vector #define PQ priority_queue #define ALL(x) x.begin(), x.end() #define SZ(x) (int)(x).size() #define FORI(i, a, b) for(int i = a; i < b ; ++i) #define FORD(i, a, b) for(int i = a; i > b ; --i) using namespace std; using pii = pair; const clock_t START_T = clock(); double time_running(){ return (double)(clock() - START_T) / CLOCKS_PER_SEC; } int main(){ ifstream cin("battle.in"); ofstream cout("battle.out"); mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); int t, n, h, l, r; cin >> t; while(t--){ cin >> n >> h; int dmg = 0; FORI(_,0,n){ cin >> l >> r; dmg += l + r; } dmg = dmg / 2 + (dmg % 2); cout << (dmg < h ? "NO\n" : "YES\n"); } // cerr << time_running() << endl; return 0; }