#include <bits/stdc++.h>
using namespace std;
using ii = long long;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, x, y;
    cin >> n >> x;
    vector<pair<int, int>> v(n);
    for (int i = 0; i < n; ++i) {
      int a, b;
      cin >> a >> b;
      v[i] = {b - a, a};
    }
    int o = 0;
    for (int i = 0; i < n; ++i) {
      o = max(o, v[i].second);
    }
    if (o >= x) {
      cout << 1 << "\n";
      continue;
    }
    sort(v.begin(), v.end());
    y = -v[0].first;
    if (y <= 0) {
      cout << -1 << "\n";
      continue;
    }
    int f = 0;
    if (o > y) {
      f++;
      x -= o;
    }
    f += x / y;
    f += !!(x % y);
    cout << f << "\n";
  }
}
