#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, x;
    cin >> n >> x;
    vector<pair<int, int> > arr(n);
    int maxx = 0;
    int maxxdiff = 0;
    for (int i = 0; i < n; i++) {
      cin >> arr[i].first >> arr[i].second;
      maxx = max(maxx, arr[i].first);
      maxxdiff = max(maxxdiff, arr[i].first - arr[i].second);
    }
    int target = x - maxx;
    if (target <= 0) {
      cout << "1" << endl;
      continue;
    }
    if (maxxdiff <= 0) {
      cout << "-1" << endl;
      continue;
    }
    cout << (target / maxxdiff + (target % maxxdiff == 0 ? 0 : 1) + 1) << endl;
  }
  return 0;
}
