#include <bits/stdc++.h>
using namespace std;
inline long long gcd(long long a, long long b) {
  if (a % b == 0)
    return b;
  else {
    return gcd(b, a % b);
  }
}
inline long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
inline long long gaus(long long a, long long b) {
  return (a + b) * (b - a + 1) / 2;
}
template <class T>
ostream& operator<<(ostream& os, vector<T> v) {
  os << "[";
  int cnt = 0;
  for (auto vv : v) {
    os << vv;
    if (++cnt < v.size()) os << ",";
  }
  return os << "]";
}
template <class L, class R>
ostream& operator<<(ostream& os, map<L, R> v) {
  os << "[";
  int cnt = 0;
  for (auto vv : v) {
    os << vv;
    if (++cnt < v.size()) os << ",";
  }
  return os << "]";
}
template <class L, class R>
ostream& operator<<(ostream& os, pair<L, R> p) {
  return os << "(" << p.first << "," << p.second << ")";
}
void solve() {
  int t;
  cin >> t;
  while (t--) {
    long long n, x;
    cin >> n >> x;
    long long mxd = 0;
    vector<long long> v(n);
    for (int i = 0; i < n; i++) {
      long long a, b;
      cin >> a >> b;
      v[i] = a - b;
      mxd = max(mxd, a);
    }
    sort(v.begin(), v.end(), greater<long long>());
    if (x > mxd && v[0] <= 0)
      cout << -1 << '\n';
    else {
      long long ans = 0;
      if (x > mxd) {
        ans = (x - mxd - 1) / v[0] + 2;
      } else
        ans = 1;
      cout << ans << '\n';
    }
  }
}
int main() {
  cin.tie(0), ios_base::sync_with_stdio(false);
  solve();
  return 0;
}
