#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, x;
  cin >> n >> x;
  vector<pair<long long, long long>> v(n);
  set<long long> s;
  long long max_profit = -1;
  long long max_blow = -1;
  for (long long i = 0; i < n; i++) {
    cin >> v[i].first >> v[i].second;
    max_profit = max(max_profit, v[i].first - v[i].second);
    max_blow = max(max_blow, v[i].first);
    s.insert(v[i].first);
  }
  if (s.lower_bound(x) == s.end() && max_profit <= 0) {
    cout << "-1"
         << "\n";
  } else {
    if (s.lower_bound(x) != s.end()) {
      cout << "1"
           << "\n";
      return;
    }
    long long ans = 0;
    x -= max_blow;
    ans++;
    ans += (x + max_profit - 1) / max_profit;
    cout << ans << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int test;
  cin >> test;
  while (test-- > 0) {
    solve();
  }
  return 0;
}
