#include <bits/stdc++.h>
using namespace std;
long long solve() {
  long long n, x, a, b;
  cin >> n >> x;
  vector<long long> blow;
  long long maxD = -1;
  for (__typeof(n) i = (0) - ((0) > (n)); i != (n) - ((0) > (n));
       i += 1 - 2 * ((0) > (n))) {
    cin >> a >> b;
    blow.push_back(a - b);
    maxD = max(maxD, a);
  }
  sort(blow.begin(), blow.end());
  long long left = x - maxD;
  if (left <= 0) {
    return 1;
  }
  if (blow.size() <= 0 || blow.back() <= 0) return -1;
  long long better = blow.back();
  ;
  ;
  long long count = ((left + better - 1) / better);
  return count + 1;
}
int main() {
  std::ios::sync_with_stdio(false);
  long long t;
  cin >> t;
  while (t--) {
    cout << solve() << "\n";
  }
}
