#include <bits/stdc++.h>
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug& operator<<(const c&) {
    return *this;
  }
};
void solve() {
  long long n, x;
  cin >> n >> x;
  vector<long long> c(n);
  vector<long long> b(n);
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    long long v1, v2;
    cin >> v1 >> v2;
    c[i] = v1 - v2;
    b[i] = v1;
  }
  sort(b.rbegin(), b.rend());
  sort(c.rbegin(), c.rend());
  if (b[0] < x && c[0] <= 0) {
    cout << -1 << endl;
    return;
  }
  x -= b[0];
  ans++;
  if (x <= 0) {
    cout << ans << endl;
    return;
  }
  ans += (x / c[0]);
  if (x % c[0] != 0) ans++;
  cout << ans << endl;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    solve();
  }
}
