#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n, x;
  int d, h;
  long long int t;
  cin >> t;
  while (t--) {
    cin >> n >> x;
    int maxm = INT_MIN, maxd = INT_MIN;
    for (int i = 0; i < n; i++) {
      cin >> d >> h;
      maxm = max(maxm, d - h);
      maxd = max(maxd, d);
    }
    if (x <= maxd) {
      cout << 1 << endl;
    } else {
      if (maxm <= 0)
        cout << -1 << endl;
      else
        cout << 1 + (x - maxd + maxm - 1) / maxm << endl;
    }
  }
  return 0;
}
