#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n = 0, x = 0;
    cin >> n >> x;
    long long d = 0, h = 0;
    long long maxDif = 0;
    long long maxCut = 0;
    for (int i = 0; i < n; i++) {
      cin >> d >> h;
      maxCut = max(maxCut, d);
      maxDif = max(maxDif, d - h);
    }
    if (maxCut >= x) {
      cout << "1\n";
      continue;
    } else if (maxDif <= 0) {
      cout << "-1\n";
      continue;
    }
    int stepsTillMaxCut = (x - maxCut) / maxDif;
    if (x - stepsTillMaxCut * maxDif > maxCut) stepsTillMaxCut++;
    cout << 1 + stepsTillMaxCut << endl;
  }
}
