#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  int t;
  cin >> t;
  while (t--) {
    int maxa = 0, maxd = 0;
    int n, m;
    cin >> n >> m;
    bool ok = 0;
    for (int i = 0; i < n; i++) {
      int d, h;
      cin >> d >> h;
      if (d >= m) ok = 1;
      maxa = max(d, maxa);
      maxd = max(maxd, d - h);
    }
    if (ok)
      cout << 1 << endl;
    else if (maxd <= 0)
      cout << -1 << endl;
    else {
      m -= maxa;
      if (m <= 0)
        cout << 1 << endl;
      else {
        if (m % maxd == 0)
          cout << m / maxd + 1 << endl;
        else {
          cout << m / maxd + 2 << endl;
        }
      }
    }
  }
  return 0;
}
