#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 4;
long long a[N], c[N];
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long x, n, u, v, w = 0, z, maxx = -1;
    cin >> n >> x;
    for (long long i = 1; i <= n; i++) {
      cin >> a[i] >> c[i];
      if (a[i] - c[i] > maxx) {
        maxx = a[i] - c[i];
        u = a[i], v = c[i];
      }
      w = max(w, a[i]);
    }
    if (maxx <= 0 && w < x) {
      cout << "-1" << endl;
      continue;
    }
    x -= w;
    if (x <= 0) {
      cout << "1" << endl;
    } else {
      if (x % maxx == 0)
        cout << x / maxx + 1 << endl;
      else
        cout << x / maxx + 2 << endl;
    }
  }
}
