#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, x;
  cin >> n >> x;
  int ans = -1;
  int att = 0;
  int ult = 0;
  int d, h;
  for (int i = 0; i < n; ++i) {
    cin >> d >> h;
    if (d > ult) {
      ult = d;
    }
    if (d - h > att) {
      att = d - h;
    }
  }
  if (x > ult && att <= 0) {
    cout << "-1\n";
  } else if (x <= ult) {
    cout << "1\n";
  } else {
    ans = (x - ult) / att;
    if (ans * att < x - ult) {
      ans++;
    }
    ans++;
    cout << ans << "\n";
  }
}
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; ++i) {
    solve();
  }
  return 0;
}
