#include <bits/stdc++.h>
using namespace std;
bool comp(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.first == b.first) return a.second < b.second;
  return a.first > b.first;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    long long n, x;
    cin >> n >> x;
    vector<pair<long long, long long> > v(n);
    for (long long i = 0; i < n; i++) {
      long long a, b;
      cin >> a >> b;
      v[i] = {a, b};
    }
    sort(v.begin(), v.end(), comp);
    if (v[0].first >= x) {
      cout << 1 << "\n";
      continue;
    }
    long long att = -1;
    for (long long i = 0; i < v.size(); i++) {
      att = max(att, v[i].first - v[i].second);
    }
    if (att <= 0)
      cout << -1 << "\n";
    else
      cout << ((x - v[0].first + att - 1) / att) + 1 << "\n";
  }
  return 0;
}
