#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios_base::sync_with_stdio(0);
  std::cin.tie(0);
  std::cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long long n, x;
    cin >> n >> x;
    vector<pair<int, int> > h;
    long long mxd = INT_MIN, mxc = INT_MIN;
    for (long long i = 0; i < (long long)n; i++) {
      long long d, in;
      cin >> d >> in;
      mxd = max(d - in, mxd);
      mxc = max(mxc, d);
    }
    cout.precision(13);
    if (mxc >= x) {
      cout << 1 << "\n";
      continue;
    }
    if (mxd <= 0) {
      cout << -1 << "\n";
      continue;
    }
    cout << ceil((long double)(x - mxc) / (long double)mxd) + 1 << "\n";
  }
  return 0;
}
