#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n, x, i, j;
  cin >> n >> x;
  long long int mm = 0;
  long long int mx = 0;
  for (i = 0; i < n; i++) {
    long long int a, b;
    cin >> a >> b;
    mm = max(mm, a - b);
    mx = max(mx, a);
  }
  if (x <= mx) {
    cout << "1\n";
    return;
  }
  if (mm <= 0) {
    cout << "-1\n";
    return;
  }
  long long int p = x - mx;
  long long int q = p / mm;
  if (p % mm != 0) {
    q++;
  }
  x -= (q * mm);
  if (x > 0) {
    q++;
  }
  cout << q << "\n";
}
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t > 0) {
    t--;
    solve();
  }
}
