#include <bits/stdc++.h>
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  std::cout << name << " : " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  std::cout.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long i, j, n, m, k, cnt = 0, ans = 0, t = 1;
  cin >> t;
  while (t--) {
    long long x;
    cin >> n >> x;
    long long d[n], h[n], bl = LLONG_MIN, mx = LLONG_MIN;
    for (i = 0; i < n; i++) {
      cin >> d[i] >> h[i];
      bl = max(bl, d[i] - h[i]);
      mx = max(d[i], mx);
    }
    if (mx >= x)
      cout << 1 << '\n';
    else {
      if (bl <= 0)
        cout << -1 << '\n';
      else {
        k = (x - mx) / bl + ((x - mx) % bl != 0 ? 1 : 0);
        cout << k + 1 << '\n';
      }
    }
  }
  return 0;
}
