#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t, n, x, i, m;
  cin >> t;
  while (t--) {
    m = 0;
    cin >> n >> x;
    int d[n], h[n];
    vector<pair<int, int> > a(n);
    for (i = 0; i < n; i++) cin >> d[i] >> h[i];
    for (i = 0; i < n; i++)
      if (d[i] > m) m = d[i];
    for (i = 0; i < n; i++) a[i] = {d[i] - h[i], d[i]};
    sort(a.begin(), a.end());
    if (a[n - 1].first <= 0 && m < x)
      cout << -1 << endl;
    else {
      x = x - m;
      if (x <= 0)
        cout << 1 << endl;
      else if (x % a[n - 1].first == 0)
        cout << 1 + x / a[n - 1].first << endl;
      else
        cout << 2 + x / a[n - 1].first << endl;
    }
  }
}
