#include <bits/stdc++.h>
using namespace std;
int main() {
  int test;
  cin >> test;
  while (test--) {
    int n, x;
    cin >> n >> x;
    int diff = 0;
    pair<int, int> p[n];
    for (int i = 0; i < n; i++) {
      cin >> p[i].first >> p[i].second;
      if (diff < p[i].first - p[i].second) {
        diff = p[i].first - p[i].second;
      }
    }
    sort(p, p + n);
    reverse(p, p + n);
    if (p[0].first >= x) {
      cout << "1\n";
      continue;
    }
    if (diff <= 0) {
      cout << "-1\n";
      continue;
    } else {
      cout << int(1 + ceil(((long double)(x - p[0].first)) / diff)) << "\n";
    }
  }
}
