#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long int n, hax, maxii = INT_MIN;
    cin >> n >> hax;
    long long int m[n], p[n], curreh = hax, ss = 0, bigg = INT_MIN;
    for (int i = 0; i < n; i++) {
      cin >> m[i] >> p[i];
      bigg = max(m[i] - p[i], bigg);
      maxii = max(m[i], maxii);
    }
    if (maxii >= curreh) {
      cout << ss + 1 << endl;
      continue;
    }
    if (bigg <= 0) {
      cout << "-1" << endl;
      continue;
    }
    (curreh - maxii) % bigg == 0 ? ss = (curreh - maxii) / bigg
                                 : ss = (curreh - maxii) / bigg + 1;
    cout << ss + 1 << endl;
  }
  return 0;
}
