#include #define endl '\n' using namespace std; void solve() { long long n, h; cin >> n >> h; vector > v(n); for (int i = 0; i < n; i++) cin >> v[i].first >> v[i].second; long long p = 0; for (int i = 0; i < n; i++) { p += (v[i].first + v[i].second) / 2; } if (p >= h) cout << "YES" << endl; else cout << "NO" << endl; } int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); freopen("battle.in", "r", stdin); freopen("battle.out", "w", stdout); int t; cin >> t; while (t--) solve(); return 0; } /** 3 1 4 4 6 1 5 4 6 1 6 4 6 YES YES No */