#include <bits/stdc++.h>
using namespace std;
const long long int INF = 1e18L + 5;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int T = 1;
  cin >> T;
  while (T--) {
    long long int n, x, i, y, z, a, b, m = 0;
    cin >> n >> x;
    vector<pair<long long int, pair<long long int, long long int> > > v;
    int flag = 0;
    for (i = 0; i < n; i++) {
      cin >> y >> z;
      if (y > z)
        v.push_back({y - z, {y, z}});
      else if (y == z && y == x)
        v.push_back({y - z, {y, z}});
      m = max(m, y);
    }
    if (m >= x) {
      cout << "1" << endl;
      continue;
    }
    if (v.size() == 0) {
      cout << "-1" << endl;
      continue;
    }
    sort(v.begin(), v.end(),
         greater<pair<long long int, pair<long long int, long long int> > >());
    x -= m;
    a = (v.begin()->second).first;
    b = (v.begin()->second).second;
    long long int cunt = 1;
    double d;
    d = (double)(x) / abs(b - a);
    cunt += ceil(d);
    cout << cunt << endl;
  }
}
