#include <bits/stdc++.h>
using namespace std;
int64_t ans, n, k, m, r[100001], baap[100001];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int64_t t;
  cin >> t;
  int64_t a, b;
  while (t--) {
    m = 0;
    cin >> n >> k;
    for (int i = 0; i <= n - 1; i++) {
      cin >> a >> b;
      m = max(a, m);
      r[i] = a - b;
    }
    sort(r, r + n);
    a = r[n - 1];
    if (a <= 0 && m < k) {
      cout << "-1\n";
      continue;
    }
    if (m >= k) {
      cout << "1\n";
      continue;
    }
    b = (k - m) / a;
    if (b * a < (k - m)) ++b;
    ++b;
    cout << b << endl;
  }
  return 0;
}
