#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, cur;
  scanf("%d", &n);
  scanf("%d", &cur);
  int mxVal = INT_MIN, mxDiff = INT_MIN;
  for (int i = 0; i < n; i++) {
    int x, y;
    scanf("%d", &x);
    scanf("%d", &y);
    mxVal = max(mxVal, x);
    mxDiff = max(mxDiff, x - y);
  }
  if (cur > mxVal and mxDiff <= 0) {
    cout << "-1" << endl;
  } else if (mxVal >= cur) {
    cout << 1 << endl;
  } else {
    long long int a = ceil(1.0 * (cur - mxVal) / mxDiff);
    cout << a + 1 << endl;
  }
}
int main() {
  int nt = 1;
  scanf("%d", &nt);
  while (nt--) {
    solve();
  }
}
