#include <bits/stdc++.h>
using namespace std;
const int INF = 1987654321;
const long long mod = 1000000007;
const double PI = acos(-1);
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, x, d = -1, eff = -INF;
    cin >> n >> x;
    for (int i = 0; i < n; i++) {
      int di, hi;
      cin >> di >> hi;
      d = max(d, di);
      eff = max(eff, di - hi);
    }
    if (x <= d) {
      cout << "1\n";
      continue;
    }
    if (eff <= 0) {
      cout << "-1\n";
      continue;
    }
    int res = ((x - d) % eff) ? (x - d) / eff + 2 : (x - d) / eff + 1;
    cout << res << '\n';
  }
}
