#include <bits/stdc++.h>
using namespace std;
bool comp(pair<int, int> a, pair<int, int> b) {
  if (a.second - a.first == b.second - b.first) return a.first > b.first;
  return a.second - a.first < b.second - b.first;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, x;
    cin >> n >> x;
    std::vector<pair<int, int> > arr(n);
    bool fl = false;
    int mx = 0;
    for (int i = 0; i < n; i++) {
      int d, h;
      cin >> d >> h;
      if (d >= x) fl = true;
      arr[i] = make_pair(d, h);
      mx = max(mx, d);
    }
    sort(arr.begin(), arr.end(), comp);
    if (fl) {
      cout << "1\n";
      continue;
    }
    int effect = arr[0].second - arr[0].first;
    if (effect >= 0) {
      cout << "-1\n";
      continue;
    }
    x -= mx;
    int ans = ceil((long double)x / abs(effect));
    cout << ans + 1 << "\n";
  }
}
