#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  for (long long test = 0; test < t; test++) {
    long long n, x;
    cin >> n >> x;
    long long *h = new long long[n];
    long long *d = new long long[n];
    long long maxi = LONG_LONG_MIN;
    long long diff = LONG_LONG_MIN;
    for (long long i = 0; i < n; i++) {
      cin >> d[i] >> h[i];
      maxi = max(maxi, d[i]);
      diff = max(diff, (d[i] - h[i]));
    }
    if (diff <= 0) {
      if (x <= maxi) {
        cout << 1 << "\n";
        continue;
      }
      cout << -1 << "\n";
      continue;
    } else {
      long long res = ceil((double)(x - maxi) / diff);
      res = max(res, (long long)(0));
      res++;
      cout << res << "\n";
    }
  }
}
