#include <bits/stdc++.h>
using namespace std;
int main() {
  int tst;
  cin >> tst;
  while (tst--) {
    int n, k;
    cin >> n >> k;
    vector<pair<int, int> > v;
    for (int i = 0; i < n; i++) {
      int x, y;
      cin >> x >> y;
      v.push_back({x, y});
    }
    sort(v.begin(), v.end());
    int div = 0, mx = -1;
    n = v.size();
    for (int i = 0; i < n; i++) {
      int x = (v[i].first - v[i].second);
      div = max(x, div);
      mx = max(mx, v[i].first);
    }
    if (mx >= k) {
      cout << "1" << endl;
      continue;
    }
    k -= mx;
    if (n == 0 || div == 0)
      cout << "-1" << endl;
    else
      cout << ((k + div - 1) / div) + 1 << endl;
  }
  return 0;
}
