#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, x;
    cin >> n >> x;
    int d[n], h[n];
    for (int i = 0; i < n; i++) {
      cin >> d[i] >> h[i];
    }
    int maxD = d[0];
    int l = 0;
    for (int i = 1; i < n; i++) {
      if (d[i] > maxD) {
        maxD = d[i];
        l = i;
      }
    }
    int y = 0;
    int maxDiff = d[0] - h[0];
    for (int i = 1; i < n; i++) {
      if (d[i] - h[i] > maxDiff) {
        maxDiff = d[i] - h[i];
      }
    }
    if (x - maxD <= 0) {
      cout << 1 << "\n";
      continue;
    }
    if (maxDiff <= 0) {
      cout << -1 << "\n";
      continue;
    }
    int count = 0;
    count = int(ceil(double(x - maxD) / maxDiff));
    cout << count + 1 << "\n";
  }
  return 0;
}
