#include <bits/stdc++.h>
using namespace std;
const int maxn = 107;
int n, x, d, h, diff, ans, mxVal, c;
void solve() {
  diff = mxVal = -2147483648;
  cin >> n >> x;
  for (int i = 0; i < n; ++i) {
    cin >> d >> h;
    diff = max(diff, d - h);
    mxVal = max(mxVal, d);
  }
  c = x - mxVal;
  if (c > 0) {
    if (diff <= 0) {
      ans = -1;
    } else {
      ans = (c + diff - 1) / diff;
      ans++;
    }
  } else {
    ans = 1;
  }
  cout << ans << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
